This code works fine but i dont want show btnvalue which is zero and one istead of that i want show Log-In Log-out with checking btnvalue which is zero and one. Help me with the correct syntax of checking value or if/else condtion inside td tag.
<?php
if(isset($_POST["from_date"] , $_POST["to_date"]))
{
$connect = mysqli_connect("localhost", "root", "root", "attendance");
$output = '';
$query ="SELECT * FROM logintime WHERE date BETWEEN '".$_POST["from_date"]."' AND '".$_POST["to_date"]."' UNION SELECT * FROM logouttime WHERE date BETWEEN '".$_POST["from_date"]."' AND '".$_POST["to_date"]."'
";
$result = mysqli_query($connect, $query);
$output .= '
<table class="table table-bordered">
<tr>
<th>EMP-ID</th>
<th>STATUS</th>
<th>TIME</th>
<th>DATE</th>
<th>DAILY JOB</th>
</tr>
';
if(mysqli_num_rows($result)>0)
{
while($row = mysqli_fetch_assoc($result))
{
$output .= '
<tr>
<td>'. $row["techid"] .'</td>
<td>'. $row["btnvalue"].'</td>
<td>'. $row["time"] .'</td>
<td>'. $row["date"] .'</td>
<td>'. $row["comment"] .'</td>
</tr>
';
}
}
else
{
$output .= '
<tr>
<td colspan="5">No Attendance Found</td>
</tr>
';
}
$output .= '</table>';
echo $output;
}
?>