jeudi 8 décembre 2016

adding a comment system to a "looped" page

I've listed multiple articles on my site. Each can be accessed through a single .php file which displays the article's data from MySQL database per id.

<?php $id = (int)$_GET['id'];
$pegaArticle = $pdo->prepare("SELECT * FROM `articles` WHERE id = ?");
$pegaArticle->execute(array($id)); 
while($article = $pegaArticle->fetchObject()){   ?> ... <?php } ?>

Now I want for to create a comment system for each article. Should I make a new comment-database and somehow link it to every article per its id or something? Since I can't create the comments in the article database, because they wouldn't fit in, right?

Sorry for the poor explanation, hopefully someone understands me. If not, please ask.

Aucun commentaire:

Enregistrer un commentaire