I keep getting the smurf error from this simple code
$sql = "update $table_name set usergroup = '$approved' where username = '$username' ";
The error is
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 'set usergroup = 'Users' where username = 'dodo'' at line 1
The only thing I can see in the error message is the different quotes around 'dodo" . The above message is a cut and paste so there are no typos.
Any help greatly appreciated.
Thanks
Driving me nuts! any clues
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Driving me nuts! any clues
If you do echo $sql; what is the actual SQL statement being executed?
(#10850)
Re: Driving me nuts! any clues
Thanks, I did not know that was possible. The result of echo $sql was
update set usergroup = 'Users' where username = 'dodo'
So the "table name" is missing from the update statement. I replaced it manually rather than using a var and it works fine.
Thanks for the tip on the echo $sql. I will use that alot from now on.
update set usergroup = 'Users' where username = 'dodo'
So the "table name" is missing from the update statement. I replaced it manually rather than using a var and it works fine.
Thanks for the tip on the echo $sql. I will use that alot from now on.