Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/06/2010, 06:51
Avatar de martin0341
martin0341
 
Fecha de Ingreso: septiembre-2006
Ubicación: Rosario - Santa Fe
Mensajes: 296
Antigüedad: 17 años, 7 meses
Puntos: 8
Respuesta: Contar comentarios.

Supongamos que la tablas se llaman noticias y comentarios.
Entonces:
Código PHP:
Ver original
  1. SELECT COUNT( comentarios.id ) , noticias.id
  2. FROM noticias, comentarios
  3. WHERE comentarios.id_2 = noticias.id
  4. GROUP BY comentarios.id_2

Saludos