Basically, I have a database with 10 exam types. Each type has two parts, and is updated as pass or fail. I need to list the total count of exams that have not been completed (both parts passed).
I've tried this and it returns the count if either part shows pass, not both.
$sql1 = $con->query("SELECT * FROM candidate_exams WHERE gID='1' AND canID='$canID' AND exResult='y' GROUP BY gEID");
$rowcount1 = 10 - mysqli_num_rows($sql1);
'gID' is just an identifier that tracks what group these 10 exams come from, 'canID' is my candidate identifier, 'gEID' is my exam type.
SELECT COUNT(*) FROM tabele WHERE type_a = 'fail' OR type_b = 'fail'
something like this? It would help a lot to see your table structure to be able to answer this question properly.