Sql manual say:
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1, [col_name2=expr2, ...] [WHERE where_definition] [ORDER BY ...] [LIMIT #]
so why dont work query:
UPDATE links SET new=0 ORDER BY date desc LIMIT 5
Somebody understand it?
The mysql docs read as follows:
6.4.5 UPDATE Syntax
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1 [, col_name2=expr2, ...] [WHERE where_definition] [LIMIT #]
I have no idea where you got what you put in. Here is the link where I got mine: http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#UPDATE
I read it here: http://www.mysql.com/doc/en/UPDATE.html
there is row at top of the text saying: If the ORDER BY clause is specified, the rows will be updated in the order that is specified.
the user comments on that page bring up the same issue. The problem is, the syntax for UPDATE doesn't show the ORDER BY clause in it. possibly not supported (yet)?
I think too, thats not supported, but why they write about it in manual? I need this function to update. I dont know how to update data without sort them by date. There should be some possibility how to update data sorted by some column. How to manage it without mysql function. Use arrays or something?