I am trying to find the number of different things in my database, using SELECT COUNT(*). The problem is when there are zero --
For example,
SELECT COUNT(*) FROM `images` WHERE `approved` = '1'
If there are no results, I will still get a 0 back and can check $result['COUNT(*)']
.
But with this query,
SELECT COUNT(*) , `first_name` , `last_name` , `email`
FROM `images`
WHERE `approved` = '0'
AND (
`first_name` = ''
AND `last_name` = ''
AND `email` = ''
)
GROUP BY `first_name` , `last_name` , `email`
I just get an empty result set.
How can I just get a 0 if there are no results, with this query?