I'm quering my database as below:
<?php
while($date <= $end) {
$ttl++;
$student_array = array();
$stu_name_td = '';
mysqli_data_seek($result,0);
while($innerrow = mysqli_fetch_array($result)) {
$atd_query = "SELECT * FROM attendance WHERE AttDate = '".date('Y-m-d', $date)."' AND sl_no = '".$innerrow['sl_no']."'";
$present_stu_res = mysqli_query($link, $atd_query);
$test = mysqli_num_rows($present_stu_res) > 0 ? 1 : 0;
}
echo "<th>".date('j/m/Y', $date)."</th>";
$date = strtotime("+1 day", $date);
}
?>
How can I display P in the place of 1 and A in the place of 0 in my report?
Modify your code as :
(mysqli_num_rows($present_stu_res) > 0) ? "P" : "A";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With