MYSQL SYNTAX ERROR - PLEASE HELP!

I cant find the problem here:

[php]$u = “UPDATE prueba SET NAME=&_POST[inputNAME], DESCRIPTION=&_POST[inputDESCRIPTION] WHERE ID = &_POST[id]”;[/php]

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 ‘&_POST[inputNAME], DESCRIPTION=&_POST[inputDESCRIPTION] WHERE ID = &_POST[id]’ at line 1

help!! :smiley:

Your problem is your &_POST values. You retrieve POST values using the $ sign not the & sign. Try this:

[php]
$u = “UPDATE prueba SET NAME=’$_POST[inputNAME]’, DESCRIPTION=’$_POST[inputDESCRIPTION]’ WHERE ID = ‘$_POST[id]’”;

[/php]

I’ve also taken the quotes out from the database columns and put them around the values as they are suppose to be. Try this code out and see if it does what you need it to do =D.

thanx! worked perfectly!

Sponsor our Newsletter | Privacy Policy | Terms of Service