query($sql); $resultatArray = $resultat ->fetchAll(); echo json_encode($resultatArray); ?>