Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/11/2015, 10:47
JEMG002
 
Fecha de Ingreso: octubre-2015
Ubicación: Puebla, Puebla
Mensajes: 12
Antigüedad: 8 años, 6 meses
Puntos: 0
Respuesta: Como hacer 2 consultas en PHP con MySQL

Hola, para poner el total al final de los registros encontrados (Debajo de ellos) sería así:

Código PHP:
Ver original
  1. $sum2 = mysql_fetch_row($sum);
  2. while($fila=mysql_fetch_row($res)){
  3.    echo '<tr>';
  4.    echo '<td>'.$fila[1].'</td>';
  5.    echo '<td>'.$fila[2].'</td>';
  6.    echo '<td>'.$fila[3].'</td>';
  7.    echo '<td>'.$fila[4].'</td>';
  8.    echo '<td>'.$fila[5].'</td>';
  9.    echo '</tr>';
  10. }
  11. echo '<tr>';
  12. echo '<td>Total: </td>';
  13. echo '<td>'.$sum2[0].'</td>';
  14. echo '</tr>';
  15.  
  16. echo '</table>'


¡Saludos!