I'm calling a table from mySQL database using PDO as you can see :
$reponse = $bdd->query('SELECT * FROM exercices WHERE chapitre=\'hello\' ORDER BY id DESC');
Now, I want to do the same thing but instead of 'hello' I would like to use a variable set before like that :
$reponse = $bdd->query('SELECT * FROM exercices WHERE chapitre=\'echo $cat\' ORDER BY id DESC');
It doesn't work. I may have a problem with "echo $cat". Somebody knows ? Thanks.