MySQL Forums
Forum List  »  PHP

updateing random rows
Posted by: Jason Baxter
Date: August 24, 2005 09:12AM

Ok I'm having problems with a UPDATE command; it seems to be the LIMIT as it works with out.
The error I get 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 'ORDER BY RAND()' at line 1

And the script is:

mysql_query("UPDATE `table` SET `column` = 'new value' WHERE ` column ` = 'value' AND `column` = '1' LIMIT " . $limitingVar . " ORDER BY RAND()") or die(mysql_error());


Anyone have any ideas?

Options: ReplyQuote


Subject
Written By
Posted
updateing random rows
August 24, 2005 09:12AM
August 24, 2005 09:25AM
August 24, 2005 09:25AM
August 24, 2005 09:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.