I want to execute this query in php page.
the query:
BEGIN
SET @p=0;
UPDATE users SET cityrate = (@p:=@p+1) WHERE cityid=1 ORDER BY power DESC;
END
options (that dont work) that i already tried:
mysql_query(" BEGIN
SET @p=0;
UPDATE users SET cityrate = (@p:=@p+1) WHERE cityid=1 ORDER BY power DESC;
END");
and
mysql_query("SET @p=0;
UPDATE users SET cityrate = (@p:=@p+1) WHERE cityid=1 ORDER BY power DESC;");
Till now used this query on events but events aren't allowed on some hosts. so I am going to use this on cronjobs.
Pls help me.