Probably the space around field name “filename” or is it “thumbnail”? Turn on error reporting during development. Use back ticks or no space around field names.
$sql = "INSERT INTO videos (thumbnail) VALUES( '$thumbnail' )";
Thank you for your reply. Can you please give me an example of what I need to “Turn on error reporting”? Also, when the code is this:
$sql = "INSERT INTO videos (thumbnail) VALUES( '$thumbnail' )";
The image file name appears in the thumbnail column, in the ‘videos’ table, but in its own row, not in the row with all the other Upload Form info.
Can you please help me teak this so it’s all in the same row?
Hard to know what you are talking about. You haven’t posted any form or “other” table processing code. If this “Image processing” is supposed to go in another table with other POST processing, make it so.
Thanks for your replies. After adding error_reporting(E_ALL); and processing the Form, I see no errors.
Also, I’m not looking to have the image to “go in another table” I’m trying to get the image file to go into the same ‘videos’ table like the rest of the Upload Form entries do.
Well it seems to me you would want to validate the other form inputs and trim/escape these values before entering them with the same INPUT script that adds the thumbnail name.
Thanks for your reply/insight. I’m sure that’s probably a good idea, but I’m not sure if that will get me to my primary goal of getting the image file into the same row as the other Form entry info, because what you’re suggesting is beyond my knowledge of how to do that, or why to do that, and it seems that the other form inputs are already appearing successfully. So, any additional help with getting the image file into the same row, will be greatly appreciated.
Thanks for your repy>
After adding:
/* development debugging */
error_reporting(E_ALL);
ini_set(‘display_errors’, TRUE);
//error_reporting(0);
//ini_set(‘display_errors’, FALSE);
Well then if you are already adding the other data with another INSERT query, then grab the record id and instead of making another INSERT query, UPDATE the record to add the thumbnail name.
IS ‘indexer’ a primary auto increment field?
You say you are adding the other info. If you add this directly after that query it should give you the ID number of that record.
$IDnum = mysql_insert_id();
You then should be able to use an UPDATE query to add the thumnail.
$sql = "UPDATE videos SET thumbnail = '$thumbnail' WHERE indexer = '$IDnum'";