Bonjour à Tous,

Voici la requête en question :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
$query = htmlspecialchars(stripslashes($_GET['q']));
 
$requeteSQL = "SELECT DISTINCT ".$field." FROM ".$table." WHERE ".$field." LIKE: queryString ORDER BY ".$field." ASC, idindex DESC LIMIT 0 , ".$limitS;
 
$sql = $pdo->prepare($requeteSQL);
$sql->execute(array(':queryString' => $query.'%'));
L'erreur PDO :

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 ': 'queryString' ORDER BY nom ASC, idindex DESC LIMIT 0 , 5'
Mais je ne vois pas ce qui cloche...