In this example, how to calculate in each row how many NULL values, how many zeros(0) and how many ones(1) and each values store in a variable.
+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
| StdID | day1S1 | day1S2 | day1S3 | day2S1 | day2S2 | day2S3 | day3S1 | day3S2 | day3S3 |
+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
| 3 | NULL | 1 | 0 | 1 | 1 | 0 | NULL | 1 | 1 |
| 4 | 1 | 1 | 0 | 1 | 0 | 0 | NULL | 1 | 1 |
+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
O/p
**StdID = 3**
$null = 2;
$zeros = 2;
$ones = 5;
**StdID = 4**
$null = 1;
$zeros = 3;
$ones = 5;
I dont know how to do this, but I am trying with the following code
$check = isset($day1['day1S1']) ? "1" : "0"; doesnt work
$values = $day1['day1S1']+$day1['day1S2']+$day1['day1S3'] etc
Please help me to solve this. Thanks