I want to select the last row from the files table, get the last file_id and modify it before writing the next record to the table,
in this example I'm doing something as simple as increasing it by one, which will not be the actual modification but. I digress, I am not getitng a value for $id in the following code, can anyone point out where I am going wrong?
$get_id = "SELECT file_id FROM [files] ORDER BY file_id DESC";
$testme = mssql_fetch_row($get_id);
echo $testme[0];
$id = $testme['file_id'];
//echo $id . "\n";
$id = $id++;
$filename = ltrim(strrchr($file,'\\'),'\\');
$submit = "INSERT into files (file_id,name,data)values" .
"($id,\"$filename\", 0x".$data['hex'].")";
echo $submit;
mssql_query($submit);
}