mattal999 Posted August 13, 2009 Share Posted August 13, 2009 Ok so, this is the code: mysql_query('UPDATE imuzic_mp3 SET valid=\'-2\', last_checked=\''.date('Y-m-d H:i:s').'\' check_now=check_now+1 WHERE id=\''.$mp3['id'].'\'') or die(mysql_error()); And this is the result: 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 'check_now=check_now+1 WHERE id='36'' at line 1 Any ideas? The query is simple. It just throws an error for no reason... Quote Link to comment https://forums.phpfreaks.com/topic/170136-solved-mysql-throws-an-error-on-a-simple-query/ Share on other sites More sharing options...
mikesta707 Posted August 13, 2009 Share Posted August 13, 2009 forgot a comma. mysql_query('UPDATE imuzic_mp3 SET valid=\'-2\', last_checked=\''.date('Y-m-d H:i:s').'\', check_now=check_now+1 WHERE id=\''.$mp3['id'].'\'') or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/170136-solved-mysql-throws-an-error-on-a-simple-query/#findComment-897447 Share on other sites More sharing options...
mattal999 Posted August 13, 2009 Author Share Posted August 13, 2009 forgot a comma. mysql_query('UPDATE imuzic_mp3 SET valid=\'-2\', last_checked=\''.date('Y-m-d H:i:s').'\', check_now=check_now+1 WHERE id=\''.$mp3['id'].'\'') or die(mysql_error()); Damn. I completely missed that. I swear I hit the comma key Thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/170136-solved-mysql-throws-an-error-on-a-simple-query/#findComment-897449 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.