hopbop Posted April 20, 2012 Share Posted April 20, 2012 ok so here is whats going on i have this small little php to update one thing in a table but it's not updating the mysql_error is 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=1 WHERE id='21'' at line 1 what is the prob because i spent a hour on this and cant git it? here is the php <?php include '../config.php'; $id = $_GET['del']; mysql_query("UPDATE call_list SET check=1 WHERE id='$id'")or die(mysql_error()); header("Location: index.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/261310-a-little-help-on-a-update-table/ Share on other sites More sharing options...
Barand Posted April 20, 2012 Share Posted April 20, 2012 Avoid reserved words for column names eg.CHECK If you do use them, put them in backticks in the query eg `check` http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/261310-a-little-help-on-a-update-table/#findComment-1339049 Share on other sites More sharing options...
hopbop Posted April 20, 2012 Author Share Posted April 20, 2012 Avoid reserved words for column names eg.CHECK If you do use them, put them in backticks in the query eg `check` http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html thank you Barand that was the prob it works now.... and now a bit more wise about naming things lol Quote Link to comment https://forums.phpfreaks.com/topic/261310-a-little-help-on-a-update-table/#findComment-1339055 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.