$sql="SELECT id, COUNT (id) AS comentarios FROM 'noticias' GROUP BY id"; $con=mysql_query($sql) or die("error".mysql_error()); $result=mysql_result($con,0); echo $total;