<?php

$host = 'localhost';
$user = 'ahmeuesz_dino';
$pwd  = 'X39IW2ho3^5h6d_5';
$db   = 'ahmeuesz_myapp';

$conn = mysqli_connect($host, $user, $pwd, $db);

$sql = "SELECT * FROM teachers";
$result = mysqli_query($conn, $sql);


$teachers = array();
while ($row = mysqli_fetch_assoc($result)) {
    $teachers[] = $row;
}

// header('Content-Type: application/json');
echo json_encode($teachers);

mysqli_close($conn);
?>
