shedokan Posted July 12, 2008 Share Posted July 12, 2008 I have this query wich won't work: UPDATE `teams` SET `ssl`=ssl+1, `ssc`='1215867984' WHERE `id`='1' and this query wich works: UPDATE `teams` SET `ssw`=ssw+1, `ssc`='1215867984' WHERE `id`='4' and I get this error: 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 'ssl+1, `ssc`=1215867984 WHERE `id`='1'' at line 1 I used the first query on 16 tables but with different id's and it worked only about half of the times. please help. Link to comment https://forums.phpfreaks.com/topic/114412-solved-mysql-query-error-problem/ Share on other sites More sharing options...
mmarif4u Posted July 12, 2008 Share Posted July 12, 2008 Are you sure that id 1 exists in table. Link to comment https://forums.phpfreaks.com/topic/114412-solved-mysql-query-error-problem/#findComment-588351 Share on other sites More sharing options...
rarebit Posted July 12, 2008 Share Posted July 12, 2008 I was going to ask if the 'ssl' field existed? Link to comment https://forums.phpfreaks.com/topic/114412-solved-mysql-query-error-problem/#findComment-588353 Share on other sites More sharing options...
PFMaBiSmAd Posted July 12, 2008 Share Posted July 12, 2008 ssl is a reserved mysql keyword. You have back-ticks around it in part of your query but not everywhere. Be consistent when writing code. Link to comment https://forums.phpfreaks.com/topic/114412-solved-mysql-query-error-problem/#findComment-588354 Share on other sites More sharing options...
shedokan Posted July 12, 2008 Author Share Posted July 12, 2008 thanks you PFMaBiSmAd I didn't know that. from now on I will always use back-ticks. thanks. Link to comment https://forums.phpfreaks.com/topic/114412-solved-mysql-query-error-problem/#findComment-588356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.