Log in

View Full Version : Mysql Query Problems



simsonite
01-13-2009, 12:45 PM
Hi,

Im not sure what im doing wrong. I am trying to run a query on my server which is usually fine however it is coming up with this message.
"Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, username) VALUES ('4','test','test','')' at line 1"
The query is

$query2 = "INSERT INTO forum_threads (subcid, title, desc, username) VALUES ('".$c."','".$title."','".$desc."','".$user."')";

Thanks in advance.

Twey
01-13-2009, 04:21 PM
DESC is a keyword in MySQL. Either name your column something else (recommended) or enclose the problematic column name in backticks (`desc`).

simsonite
01-13-2009, 06:37 PM
Thank you so much for your help