Hypersource Posted December 27, 2012 Share Posted December 27, 2012 UPDATE users SET club='$ID', write='0', editmem='0', till='0' WHERE user_name='$tik', I get 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 'write='0', editmem='0', till='0' WHERE user_name='Tester'' at line 1 help? Link to comment https://forums.phpfreaks.com/topic/272420-php-update-query-help/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 27, 2012 Share Posted December 27, 2012 The point in your query where the error is being reported at - near 'write ... is because mysql found a keyword in a location where it is not permitted. Write is a reserved keyword. You should change your column name to something else or you must enclose it in back-ticks `write` every time you use it in a query. Link to comment https://forums.phpfreaks.com/topic/272420-php-update-query-help/#findComment-1401625 Share on other sites More sharing options...
Jessica Posted December 27, 2012 Share Posted December 27, 2012 Unrelated but relevant - don't surround numeric values in quotes for SQL. Link to comment https://forums.phpfreaks.com/topic/272420-php-update-query-help/#findComment-1401629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.