Ver Mensaje Individual
  #9 (permalink)  
Antiguo 15/11/2011, 13:31
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Organizar un while

Yo lo haría así:
Código PHP:
Ver original
  1. $query = "select count('$_POST[campo]') as total from $_POST[tabla] group by('$_POST[campo]')";

Así mejor rescatas $row['total'] siempre, para eso esta el alias.

Ahora como tip, usar $_POST directamente en tu consulta SQL te hace muy vulnerable a inyecciones SQL.

Saludos.