connect_errno) { header('HTTP/1.1 500 OK'); echo json_encode( array('erreur mysql' => "Échec lors de la connexion à MySQL : (" . $mysqli->connect_errno . ") " . $mysqli->connect_error)); } else { $resultat = $mysqli->query('SELECT * FROM `vol`'); $ligne_de_resultat = $resultat->fetch_array(MYSQLI_ASSOC); header('HTTP/1.1 200 OK'); echo json_encode( $ligne_de_resultat); } } else { header('HTTP/1.1 404 OK'); echo json_encode( array('erreur' => "route inconnue ".$_SERVER['REQUEST_URI']) ); } } else { header('HTTP/1.1 404 OK'); echo json_encode( array('erreur' => "METHODE NON SUPPORTEE : ".$_SERVER['REQUEST_METHOD'])); }