SELECT @cnt:=@cnt+1 as apos, user_id, if( @onpos=-1 and user_id=, @onpos:=@cnt,0) as posloc FROM user ORDER BY user_stable_score DESC
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 ' @onpos:=@cnt,0) as posloc FROM user ORDER BY user_stable_s