I have a database that contains things like "title, "color", and so on, and I want to display these informations in a webpage. But, for some unknown reason, nothing won't appear, not even an error, which makes me totally lost.
I use this to put everything I need into an array :
<?php
try{
$req = $db ->prepare("SELECT titre, couleur, categorie, img_url, prix, type FROM articles WHERE id = 9");
$article = $req ->fetch(PDO::FETCH_ASSOC);
}
catch(PDOException $e){
echo $e;
exit();
}
?>
My connection to the database is successful, but I can't even see my array's content even if I use the
<pre> <?php print_r($array) ?> </pre>
technique. I'm basing my current code from a working one, and I can't notice what I did wrong... Thank you in advance !