I am trying to get a summary of contributions per member by using the group by clause. The actual query works but the new version of PHP runer adds a lot of stuff that makes my qery fail.
My query is:
SELECT c.ref, c.date, c.amount FROM ccc.contrib c
where 1
group by c.ref
but the final query is:
select `idx`, `ref`, `date`, `amount` From `contrib` where (1 group by `ref`) and (1<0)
Seems my group by is added between the () instead of after them.
Is ther an easy way to fix this to allow me to really use a custom query?
I've changed a template file to fix the query, but you might have a more elegant solution since I'm not that familiar with all the code and functions in it.