mapleleaf Posted November 12, 2008 Share Posted November 12, 2008 <?php $query = "UPDATE books SET title = '$book_title', author = '$author', edition = '$edition', subject = '$subject', isbn = '$isbn', condition = '$condition', price = '$price', method = '$method' WHERE id = '$id'"; $result = mysql_query($query) or die(mysql_error()); ?> gives 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 'condition = 'good', price = '6262', method = 'sell' WHERE id = '16'' at line 1 I can't see it. Maybe I should sleep!! ??? Help much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/132378-solved-need-a-pair-of-eyes/ Share on other sites More sharing options...
xtopolis Posted November 12, 2008 Share Posted November 12, 2008 condition is a reserved word. http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html a simple fix would be to enclose that word in backticks `condition` a better fix would be to rename your column Quote Link to comment https://forums.phpfreaks.com/topic/132378-solved-need-a-pair-of-eyes/#findComment-688276 Share on other sites More sharing options...
mapleleaf Posted November 12, 2008 Author Share Posted November 12, 2008 THANK YOU THANK YOU. How many times do I strain my eyes on that one. Quote Link to comment https://forums.phpfreaks.com/topic/132378-solved-need-a-pair-of-eyes/#findComment-688549 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.