1
I have a news page that pulls id
(is one of those noticias.php?id=1
), but I wanted her to tell only the news comments I’m reading, not all. That’s possible?
I already got PHP to count, but I wanted to give this specified.
PHP to tell:
<?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 of 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++; ?>
What’s the problem @Kloves?
– Jéf Bueno
is because it counts all the comments, not only the news that I’m reading.
– Paulo Cavalcante