PDA

View Full Version : SQL confusion


semprance
01-09-2007, 03:37 PM
Still a beginner to this stuff so I'm probably making an obvious mistake.. Any help would be much appreciated.

On my news entry page, when it gets to the stage where it is inserting data into the SQL table I get this error:

Could not insert data into NEWS: Unknown column '100002' in 'field list'.

This is particularly confusing me because the '100002' is the data I want to be inserted rather than the field name. Here is the syntax I am using:


$news_insert = "INSERT INTO `news` (`id`,`date`,`content`) VALUES(`" . $news_id . "`, `" . $news_date . "`, `" . $news_content . "`);";

mysql_query($news_insert) or die ('Could not insert data into NEWS: ' . mysql_error());


Any help would be appreciated greatly.

Cirtex Joshua
01-09-2007, 05:55 PM
Well,

I know really next to nothing about it, but obviously its looking for a column called 100002, so perhaps calling it incorrectly ... but thats from a n00b in the mysql code field.

semprance
01-09-2007, 09:21 PM
It's ok I fixed it :) Not sure how I fixed it but it works now :confused: thanks anyway.

Cirtex Admin
01-09-2007, 09:42 PM
Glad it's fixed :)