I have the following lines of php code which should rename a file which already exists on the server to the id generated in the last query:
$image1Oldname = "images/" . $myfile;
$image1NewName = "images/" . mysql_insert_id() . ".jpg";
rename($image1Oldname, $image1NewName);
For some reason this does not rename the file when the script is run.
Any suggestions?
Sure.
You have to learn how to debug your code.
It is not a rocket science though.