Hypersource Posted December 27, 2012 Share Posted December 27, 2012 (edited) 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? Edited December 27, 2012 by PFMaBiSmAd removed micro-font formatting Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/272420-php-update-query-help/#findComment-1401629 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.