Hello
Je ne comprends pas on dirait que ma paramètre n'est pas remplacé par la valeur contenu dans la variable
La requête final donne string 'SELECT * FROM fiche f WHERE f.societe LIKE :mot ORDER BY f.societe ASC'
et j'ai évidemment une erreur de requête "check the manual that corresponds to your MySQL server version for the right syntax to use near ':mot ORDER BY f.societe ASC' "
Voici mon code
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 $db = $app['dbs']['mysql_read']; $qb = $db->createQueryBuilder(); $qb->select('*') ->from('fiche', 'f') ->where("f.societe LIKE :mot") ->setParameter('mot', '%' . $mot . '%') ->orderBy('f.societe'); $sql = $qb->getSQL(); $fiches = $db->executeQuery($sql);
Partager