Salut les bosss de la programmation en php, voila je suis debutant et je souhaite afficher la liste des menbres de mon site
Voici le code :
</>
<?php
session_start();
$bdd = new PDO('mysql:host=localhost;dbna me=rs;charset=utf8', 'root', '');
$bdd->setAttribute(PDO::ATTR_ERRMOD E, PDO::ERRMODE_EXCEPTION);
$q = $bdd->query("SELECT pseudo FROM utilisateurs WHERE pseudo='{$_SESSION['pseudo']}");
$utilisateurs = $q->fetchAll(PDO::FETCH_OBJ);
var_dump($utilisateurs);
die();
?>
</>
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''oneone' at line 1' in C:\wamp\www\rs\pages\liste_men bre.php on line 7
( ! ) PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''oneone' at line 1 in C:\wamp\www\rs\pages\liste_men bre.php on line 7
-----