storing image_id after uploading image in article table
- by Bader
According to this question i successed to create upload image , but now i need to store the image_id to another table called articles , i do not know if this is correct , but i tried to select the image_id from table image like this
$select_image=mysql_query("select image_id from image where image_name = $fileName") or die(mysql_error());
and fetch the result to my article insert query like this
$fetch=mysql_fetch_array($select_image);
$qeuery=mysql_query("insert into articles (article_name,article_category,article_subcategory,article_body,article_summary,article_tags,article_photo,article_timedate) values ('$article_title','$CategoryID','$ProductID','$article_body','$article_summary','$fetch[image_id]','$time')") or die ('Error, Query Faild'.mysql_error());
is this correct ? the mysql_error keeps saying " Unknown column 'Penguins.jpg' in 'where clause'"