I have a news page that pulls by id
(it's one of those noticias.php?id=1
), but I wanted it to tell only the comments of the news I'm reading, not all of them. Is this possible?
I already got PHP to count, but I wanted to give this one specified.
PHP to count:
<?php
$contador = mysql_query("SELECT count(id) as total FROM 10cms_noticias_resp
WHERE id_noticia = id_noticia") or die(mysql_error());
$comentario = mysql_fetch_assoc($contador);
?>
<?php echo $comentario['total'];
?>
PHP from my page:
$id = $_GET['id'];
$noticiass = mysql_query("SELECT * FROM 10cms_noticias WHERE id = $id") or die(mysql_error()); ?>
<?php $i = 0; while($edit = mysql_fetch_assoc($noticiass)){ $i++; ?>