$sql="SELECT COUNT (id) AS comentarios FROM 'noticias' GROUP BY id"; $con=mysql_query($sql) or die("error".mysql_error()); $result=mysql_fetch_array($con); echo $result['comentarios'];