1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?php
//header('Content-Type: text/plain; charset=utf8') ;
//mb_internal_encoding("UTF-8");
$login = $_REQUEST["NomDuCompte"];
$dns = 'mysql'.':host=localhost'.';dbname=a2sls';
$connexion = new PDO( $dns, 'root', 'root');
//$connexion->exec("SET NAMES 'utf8'");
//$connexion->exec("SET CHARACTER SET 'utf8'");
$resultat= $connexion->query("SELECT prenom, nom, adresse, cp, ville, telephone, email FROM etudiant join compteutilisateur on etudiant.id = compteutilisateur.idEtudiant where login like '$login'");
$row = $resultat->fetch(PDO::FETCH_ASSOC);
/*foreach ($row as $key => $value)
//utf8_encode ($row[$key]);
utf8_encode($key);
//$row = array_map(utf8_encode, $row);*/
print_r ($row);
print /*html_entity_decode(*/json_encode ($row)/*)*/;
print json_last_error()
?> |
Partager