I have this query:
SET @runtot:=0;
SELECT Fecha, (@runtot := @runtot + Numero) AS `N`
FROM Tabla
WHERE `ID` = 2
I am using this query in a php page . But since there is one ;
in the query (at the end of SET @runtot:=0;
), the query fails for me when I try it on the php page - in Navicat it works perfectly.
What can I use instead of ;
so I can use it in php ? o How can I change the query?
Well (finally!) I was able to solve it in the following way: