Code: Select all
$result = mysql_query ("SELECT id, photo FROM products WHERE id = '$id'") or die(mysql_error());Reason being, it's looking in there, and if anything is found, it's trying to delete the filenames form the server. But often there is just a ||| in the field. Which is causing errors.
So it would be better if it only runs the following bit (not shown here), if it also checks that the field is numeric.
The filenames will always have numeric values: 234234fred.jpg, for instance.