query($query)) { // $result: The mysqli_result class
echo "
\n";
echo "SNum | Supplier Name | City | Status |
\n";
/* Fetch results */
while ( $row = $result->fetch_assoc() ){
echo "" . $row['snum'] . " | "
. $row['sname'] . " | "
. $row['scity'] . " | "
. $row['status'] . " |
\n";
}
echo "
\n";
/* Destroy the result set and free the memory used for it */
$result->close();
}
// [4] Housekeeping.
$mysqli->close();
?>