function view_report($dateval1, $dateval2, $id) {
global $connection;
$query_get = "SELECT * FROM presence WHERE p_date BETWEEN {$dateval1} AND {$dateval2} ORDER BY DATE";
$query_confirm = mysqli_query($connection, $query_get);
if(isset($_POST["show"])) {
while($record = mysqli_fetch_assoc($query_confirm)) {
$output = "<tr>";
$output .= "<td>" . $record["p_date"] . "</td>";
$output .= "<td>" . $record["p_day"] . "</td>";
$output .= "<td>" . $record["timein"] . "</td>";
$output .= "<td>" . $record["timeout"] . "</td>";
$output .= "<td>" . "06:25:22" . "</td>";
$output .= "<td>" . $record["p_date"] . "</td>";
$output .= "</tr>";
return $output;
}
}
}
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\attendance\includes\functions.php on line 90
can anyone help me out and when i remove all query and write only select * from presence it returns only 1 query