I have the following code:
SELECT c.c_id, c_name, count(h.h_id) AS count
FROM c
LEFT JOIN h ON h.h_id = c.c_id
WHERE h.info_id = 25
AND c.c_id = {$sqlrow['c_id']}
GROUP BY c.c_id
I am using PHP to select the c_id in the WHERE statement, unfortunately if there is a c_id with a count of 0 for the h_id then no rows are selected. Is there a way to get SQL to represent no rows selected as a count of 0?
Because no rows are selected for a specific c_id by WHERE loop in PHP appears to skip the row.
What about: