UPDATE mysql table error

I keep getting an error message that reads: Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘“78”’ at line 1.

The code I’m assuming there is an error here:

[php]$query1 = “UPDATE uploads SET reported = ’ " . $violation .” ', violation = ‘X’ WHERE ID=" .$imageid;[/php]

You didn’t end your QUERY…

replace ----> WHERE ID=" .$imageid;

with ----> WHERE ID-’ " . $imageid . " ’ ";
(note quotes and double quotes.)

Setting a string in PHP is $stringname = “something”;

you had $stingname = "something;

That didn’t work. I still get the same error message.

It says it is on line 1 char 78?
Do you only have one line in the code?

Also, this is a way to find the bad query code. Just echo $query1 and do not execute it. Make sure the query looks correct. If it looks right and the variables you test with are in the correct place, then it is not the update command.

Try the echo and see what you are sending to MySQL… Good luck

hi use below query. Note: here reported, and violation must be "varchar" if one of them is integer or both are columns are integer than remove single quote. Also check the $violation and $imageid values. [php] $query1 = "UPDATE uploads SET reported='".$violation."',violation='X' WHERE ID=".$imageid; [/php] Sitll your issue not resolve than give me your table schema and echo $query1 statement.

I hope this will helpful for you
Reply Your Feedback
SR

Sponsor our Newsletter | Privacy Policy | Terms of Service