The first image are my records in my database, 'enr_biometrics_id' is a user_id i just name it like that. nevermind the 'log_no'
Now, I want to display the records of enr_biometrics_id = '000000001' from date 2021-07-01 - 2021-07-15, just like the image below using and display blanks on no record on the date 2021-07-01 - 2021-07-15. Thanks for the help in advance!
I have a code right now:
<?php include('config/config.php'); ?>
<table border="1">
<tr>
<th>Log Date</th>
<th>Logs</th>
<th>Logs</th>
<th>Logs</th>
<th>Logs</th>
<th>Logs</th>
</tr>
<?php
$start_period = "2021-07-01";
$end_period = "2021-07-15";
date_default_timezone_set('UTC');
while (strtotime($start_period) <= strtotime($end_period)) {
?>
<tr>
<td><?php echo "$start_period"; ?></td>
<?php
$logs_query = mysqli_query($conn, "SELECT * FROM tb_daily_time_record WHERE date_added BETWEEN '$start_period' AND '$end_period' AND enr_biometrics_id='000000001' ")or(die(mysql_error()));
while($row_logs = mysqli_fetch_assoc($logs_query)){
$date_logs = $row_logs['date_added'];
$t_logs = $row_logs['time_log'];
?>
<td>
<?php
echo $t_logs;
?>
</td>
<?php
}
?>
</tr>
<?php
$start_period = date ("Y/m/d", strtotime("+1 days", strtotime($start_period)));
}
?>
<tr>
</table>
Getting a result like this MyCoderightnow