$query2 = "SELECT COUNT(id) AS count FROM book_exchange WHERE education_category = 'Pre-School' ";
$result2 = mysqli_query($connection, $query2);
$total = mysqli_fetch_array($result2);
$count = ($total['count'] !== null) ? $total['count'] : 0;
?>
$query = "SELECT COUNT(id) AS count FROM book_exchange WHERE education_category = 'Primary-School' ";
$result = mysqli_query($connection, $query);
$total1 = mysqli_fetch_array($result);
$count1 = ($total1['count'] !== null) ? $total1['count'] : 0;
?>
$query1 = "SELECT COUNT(id) AS count FROM book_exchange WHERE education_category = 'Secondary-School' ";
$result1 = mysqli_query($connection, $query1);
$total2 = mysqli_fetch_array($result1);
$count2 = ($total2['count'] !== null) ? $total2['count'] : 0;
?>
$query3 = "SELECT COUNT(id) AS count FROM book_exchange WHERE education_category = 'College' ";
$result3 = mysqli_query($connection, $query3);
$total3 = mysqli_fetch_array($result3);
$count3 = ($total3['count'] !== null) ? $total3['count'] : 0;
?>
$query4 = "SELECT COUNT(id) AS count FROM book_exchange WHERE education_category = 'Polytechnical-College' ";
$result4 = mysqli_query($connection, $query4);
$total4 = mysqli_fetch_array($result4);
$count4 = ($total4['count'] !== null) ? $total4['count'] : 0;
?>
$query5 = "SELECT COUNT(id) AS count FROM book_exchange WHERE education_category = 'University' ";
$result5 = mysqli_query($connection, $query5);
$total5 = mysqli_fetch_array($result5);
$count5 = ($total5['count'] !== null) ? $total5['count'] : 0;
?>