PDA

View Full Version : Tired eye's and MySQL errors... :(



lorren.biffin
May 27th, 2007, 09:32 PM
$query = "INSERT INTO books (key,author,title,publisher,year,cat) VALUES ('$bookKey','$auth','$title','$publisher','$year', '$cat');";


Can anybody tell me what's wrong with the above query? I, for the life of me, can't find anything odd about it, but I'm also very tired...can anybody find Waldo?

The Exact 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 'key,author,title,publisher,year,cat) V' at line 1

eirche
May 27th, 2007, 09:57 PM
"key" is probably a keyword in mysql. wrapped it with `key`.

lorren.biffin
May 27th, 2007, 10:22 PM
Worked :) Thanks!