Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/08/2007, 10:52
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
Re: Pasar resultado de consulta con clausula SUM() a una variable.

Es sencillo:
Código PHP:
$consulta "SELECT SUM(creditos) FROM tabla WHERE condicion";
$rst mysql_query$consulta ) or die( mysql_error() );
$row mysql_fetch_row$rst );
$suma $row[0]; 
Saludos.