The task is to number lines in the database. Those. I would do it like this:
$lines=mysql_get_lines("SELECT `id` FROM 'table' WHERE `parent`=12"); // И потом на PHP сделал бы цикл: $i=1; foreach($lines as $line){ mysql_query("UPDATE `table` SET `order`=$i WHERE `id`=".$line['id']); $i++; } Is it possible to do a similar operation with a single query to the database?