Ver Mensaje Individual
  #10 (permalink)  
Antiguo 28/11/2018, 22:31
karenlorenadg
 
Fecha de Ingreso: octubre-2008
Ubicación: Colombia
Mensajes: 451
Antigüedad: 16 años, 4 meses
Puntos: 2
Respuesta: Mostrar ventas del dia

Estoy Probando asi,

Código PHP:
Ver original
  1. <?php
  2.                          include('config/conexion.php');
  3.                          $query = "SELECT date, SUM(amount) FROM sales_order GROUP BY date ORDER BY date";
  4.                          $result = mysql_query($query);
  5.  
  6.                           while ($registro = mysql_fetch_array($result)){
  7.  
  8.                           echo "
  9.                            <tr>
  10.                                 <td>".$registro['amount']."</td>
  11.                                
  12.                             </tr>
  13.                            
  14.  
  15.                          ";
  16.                           }
  17.                           ?>


pero me salen este error

Undefined index: amount in



Y asi
Código PHP:
Ver original
  1. <?php
  2.                          include('config/conexion.php');
  3.                          $query = "SELECT date, SUM(amount) as amount FROM sales_order GROUP BY date ORDER BY date";
  4.                          $result = mysql_query($query);
  5.  
  6.                           while ($registro = mysql_fetch_array($result)){
  7.  
  8.                           echo "
  9.                            <tr>
  10.                                 <td>".$registro['amount']."</td>
  11.                                
  12.                             </tr>
  13.                            
  14.  
  15.                          ";
  16.                           }
  17.                           ?>



Me salen todos 6 valores de amount
__________________
Desarrollo de Aplicaciones de Escritorio, Sitios Web, Audio y Video en SISGUS