I´m trying to convert this foreach to all looops for printing the array from the msyql consult in screen.
$con = mysqli_connect("localhost", "root" ,"" ,"base");
if($con->connect_error)
{
die($con->mysqli_connect_error());
}
print_r ("conexion exitosa");
$sql = "SELECT code, name, grade FROM teachers WHERE status = 1 ";
$result = $con->query($sql);
$row = mysqli_fetch_array($result); //array
**foreach ($result as $row) //array as value
{
print_r($row); //print value
}**
?> ```