I am trying to show in a while loop the status (Active or Suspended) of a list of users.
0 = Active 1 = Suspended
<?php
$result = mysqli_query($con,"SELECT status FROM `e_customer`");
while($row = mysqli_fetch_array($result)) {
if ($row['status'] == "1") {
echo "Suspended";
} else {
echo "Active";
}
}
?>
The above gives me:
Notice: Undefined variable: con in /dashboard/index.php on line 101
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /dashboard/index.php on line 101
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /dashboard/index.php on line 102