Connecting Tech Pros Worldwide Forums | Help | Site Map

SQL SYNTAX ERROR help

Newbie
 
Join Date: Oct 2008
Posts: 16
#1: Nov 16 '08
The subject update failed.
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 'WHERE id = 6' at line 5.

THis error always shows when a menu is being edited.

Expand|Select|Wrap|Line Numbers
  1. $query = "UPDATE subjects SET 
  2. menu_name = '{$menu_name}', 
  3. position = {$position}, 
  4. visible = {$visible},
  5. WHERE id = {$id}"; 
  6. $result = mysql_query($query, $connection);

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,947
#2: Nov 16 '08

re: SQL SYNTAX ERROR help


Take away the comma on line 4. See if that helps.

Markus.
Newbie
 
Join Date: Oct 2008
Posts: 16
#3: Nov 16 '08

re: SQL SYNTAX ERROR help


Thank you.
Its you again.
Thankyou.

benicio
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,947
#4: Nov 16 '08

re: SQL SYNTAX ERROR help


Quote:

Originally Posted by benicio

Thank you.
Its you again.
Thankyou.

benicio

Ah, it's my slave!

No problem, friend.

Good day.
Reply