when i run the code it shows this error . "mysqli_query() expects parameter 1 to be mysqli, null given"
<?php
function confirm_query($result_set) {
if (!$reslt_set) {
die("database query failed");
}
}
function find_all_subjects() {
global $connection;
$query = "SELECT * ";
$query .= "FROM subjects ";
$query .= "WHERE visible=1 ";
$query .= "ORDER BY position ASC ";
$subject_set = mysqli_query($connection, $query);
confirm_query($subject_set);
return $subject_set;
}
?>