leke Posted September 22, 2011 Share Posted September 22, 2011 Hi, Anyone know what's wrong with this? There is meant to be a SQL syntax error, but it looks ok to me $postedThreadId = 18; $postOrderPlusOne = "UPDATE threadId SET MAX(postOrder) + 1 FROM post_table WHERE postOrder = $postedThreadId"; 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 'MAX(postOrder) + 1 FROM post_table WHERE postOrder = 18' at line 1 Thanks Link to comment https://forums.phpfreaks.com/topic/247635-cant-figure-out-whats-wrong-with-mysql-syntax/ Share on other sites More sharing options...
web_craftsman Posted September 22, 2011 Share Posted September 22, 2011 Its Syntax:http://dev.mysql.com/doc/refman/5.0/en/update.html it should be: SET `name_of_column` = new_value there is no FROM in update operator syntax Link to comment https://forums.phpfreaks.com/topic/247635-cant-figure-out-whats-wrong-with-mysql-syntax/#findComment-1271660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.