Hi, I have problem , the same number of comments that appears in all items this is my code :

<?php $requete = $bdd->query('SELECT  COUNT(c.id_commentaire) AS total FROM commentaire c INNER JOIN pytho_blog a ON a.id = c.id_article  '); while($data=$requete->fetch()) { echo $data['total']; } ?>

Thank you for your help !

problem solve, the solution was to add (WHERE id = '. $ data [' id ']) at the end

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.