Would it be better to do the following with a MySQL query or in PHP?
My query returns a count of elements and the name of the element, like so:
Jim 50
Mark 25
Chris 120
However, I'd like for it to return a 0 with the name if there are no elements, like so:
Jim 50
Todd 0
Mark 25
Chris 120
I'd like to do this in mysql if possible (if that's the best solution). Does anyone know how I can craft a query that will do this? My query currently reads:
SELECT client,count(client) FROM table GROUP BY client;
As crafted here, it simply doesn't return a client name if the count is 0.
Anyone have any suggestions?
Much respect in advance...
-CB