based on my question above, currently, when there is no image at the database, it will display a broken image while if there is an image, it will display the image. Now how to display "No Image" when there's no image 'BLOB' at MySQL database.
I uses BLOB format at the MySQL Database. Below is the code:
<?php
$query = $conn->query("SELECT * FROM report LEFT JOIN users ON report.badgeid = users.badgeid LEFT JOIN team ON team.team_id = users.team_id WHERE team.team_id = '$team' ORDER BY report.report_date DESC LIMIT 10");
$query -> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() == 0){
  echo "<table class = 'table-bordered' width ='100%'>";
  echo "<thead>";
    echo "<tr>";
        echo "<th>Date</th>
        <th>Task Name</th>
        <th>Before Task</th>
        <th>After Task</th>
        <th>OT From</th>
        <th>OT To</th>
        <th>Status</th>
        <th>Action</th>
      </tr>
    </thead>
    <tbody >
    <tr>
    <td colspan='8'>No report at this moment</td>
    </tr>
    </tbody>
    </table>";
}else{
      echo "<table class = 'table-bordered' width ='100%'>";
      echo "<thead>";
        echo "<tr>";
            echo "<th>Date</th>
            <th>Task Name</th>
            <th>Before Task</th>
            <th>After Task</th>
            <th>OT From</th>
            <th>OT To</th>
            <th>Status</th>
            <th>Action</th>
          </tr>
        </thead>
        <tbody >";
        $query = $conn->query("SELECT * FROM report LEFT JOIN users ON report.badgeid = users.badgeid LEFT JOIN team ON team.team_id = users.team_id WHERE team.team_id = '$team' ORDER BY report.report_date DESC LIMIT 10");
        while($row = $query->fetch(PDO::FETCH_ASSOC)){
        echo "<tr>";
          echo "<td rowspan='2'>". $row['report_date'] . "</td>";
          echo "<td rowspan='2'>". $row['task_name'] . "</td>";
          echo "<td align='center'><img src='data:image/jpeg;base64,".$before."'/></td>";
          echo "<td align='center'><img src='data:image/jpeg;base64,".$row['photo_after']."'/></td>";
          echo "<td rowspan='2' align='center'>". $row['ot_start']. "</td>";
          echo "<td rowspan='2' align='center'>".$row['ot_end']. "</strong></td>";
          echo "<td rowspan='2'><strong>". $row['report_status'] . "</strong></td>";
          echo "<td rowspan='2' align='center'>";
            echo "<a class='btn-view btn-primary btn-sm' href='../view_task/view_task.php?report_id=". $row['report_id'] ."' data-toggle='tooltip'>View</a>";
            echo "</td>";
        echo "</tr>";
        echo "<tr>";
          echo "<td align='center'>". $row['time_photo_before'] . "</td>";
          echo "<td align='center'>". $row['time_photo_after'] . "</td>";
        echo "</tr>";
        }
        echo "</tbody>";
      echo "</table><br>";  
    echo "</div>";
  echo "<div>";
}
?>            
 
     
    