I have a simple statement:
$update1 = mysql_query("UPDATE leads SET call = 'Call 2', user = '' WHERE ID = '$rowid'") or die(mysql_error());
That is throwing this error message:
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 'call = 'Call 2', user = '' WHERE ID = '29657'' at line 1
which I think usually means the statement before 'call' is the problem, but everything looks good to me. Any ideas?
call
is a reserved keyword. You'll need to escape it in backticks:
$update1 = mysql_query("UPDATE leads SET `call` = 'Call 2', user = '' WHERE ID = '$rowid'") or die(mysql_error());
call is reserved keyword for mysql
use backticks around it
UPDATE leads SET `call` = ....
Not sure if this is the cause of the problem, but you don't need to quote an Integer column.
Basically WHERE ID = '29657'
is just WHERE ID = 29657
as long as id is of type Integer.