Hi,
I am using group by ID WITH ROLLUP
in my mysql query. The thing is I want to store these totals in a variable in php. Is there any way to do that?
Thanks.
Hi,
I am using group by ID WITH ROLLUP
in my mysql query. The thing is I want to store these totals in a variable in php. Is there any way to do that?
Thanks.
Yes - it returns ordinary rows just like any other query would. The total can be recognised because the ID will be NULL for that row. So when you are iterating over the rows, check to see if the ID is NULL and if that happens, set the variable that you wish to set.