Niccaman Posted March 7, 2009 Share Posted March 7, 2009 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 '4 = '2' WHERE ID = '1'' at line 1 before that it was "UPDATE ... SET". Can anyone work out the solution. I have tried enclosing the column name in apostrophes... unresolved. I have been working with mysql statements for a while now. This is the first time i have used an integer as a column name and i am unsure how to accompany this change. Link to comment https://forums.phpfreaks.com/topic/148344-solved-please-help-sql-syntax-error/ Share on other sites More sharing options...
Mikedean Posted March 7, 2009 Share Posted March 7, 2009 Try `4` when you refer to that column. Link to comment https://forums.phpfreaks.com/topic/148344-solved-please-help-sql-syntax-error/#findComment-778802 Share on other sites More sharing options...
Niccaman Posted March 7, 2009 Author Share Posted March 7, 2009 Ty for responding, i mentioned i tried enclosing the 4 in apostrophes - ' still didnt work Link to comment https://forums.phpfreaks.com/topic/148344-solved-please-help-sql-syntax-error/#findComment-778806 Share on other sites More sharing options...
PFMaBiSmAd Posted March 7, 2009 Share Posted March 7, 2009 Those are back-ticks `, not single-quotes ' and you should not be using numbers as column names. Link to comment https://forums.phpfreaks.com/topic/148344-solved-please-help-sql-syntax-error/#findComment-778807 Share on other sites More sharing options...
Niccaman Posted March 7, 2009 Author Share Posted March 7, 2009 Wow, that fixed the problem, sorry for misunderstanding the first response. im a little embarrassed being ive never heard of backticks in both computer and english language. Link to comment https://forums.phpfreaks.com/topic/148344-solved-please-help-sql-syntax-error/#findComment-778809 Share on other sites More sharing options...
PFMaBiSmAd Posted March 7, 2009 Share Posted March 7, 2009 http://mysql2.mirrors-r-us.net/doc/refman/5.1/en/identifiers.html Link to comment https://forums.phpfreaks.com/topic/148344-solved-please-help-sql-syntax-error/#findComment-778816 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.