I'm coding a time registry for employes. I have two columns. Stamp_in and Stamp_Out. When an employe register in, a DateTime value is stored in db. Looking like: $datetime_now = date('Y-m-d H:i:s'); and equal when register out. But when registering in, the value in stamp_out column will be: 0000-00-00 00:00:00. And the same for registering out, in stamp_in column.
Now, when i loop this out, i like to match dates on same day to print on the same row, but i don't want the "empty" dates to print.
How should this code look like?
This is what i got so far:
PHP
//Loop out the result
while ($row = $stmt->fetch()) {
echo "<tr>";
echo "<td>" .$row['usr_stamp_in']."</td>";
echo "<td>" .$row['usr_stamp_in']."</td>";
echo "</tr>";
}
I tried
if($row['usr_stamp_in'] != "0000-00-00 00:00:00"{
while($row ...