PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$result = mysql_query("
SET @counter = 0;
SELECT `static_id`,
IF (`static_position`=@counter, @counter:=@counter+1, @counter:=@counter+1) as `static_new_position`
FROM `gcms_static` ORDER BY `static_new_position`, `static_id`") or die(mysql_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 '; SELECT `static_id`, IF (`static_position`=@counter, @counter:=' at line 1
Obviously I use some wrong method to make such query.