Ver Mensaje Individual
  #14 (permalink)  
Antiguo 15/10/2010, 11:05
troyer4
 
Fecha de Ingreso: septiembre-2010
Mensajes: 22
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Crear un array y luego extraer sus valores

Ya probre como me dijiste solo q estoy haciendo algo mal porq no me da el resultado q deberia, me muestra solo un registro por grupo y yo necesito q me muestre todos los registros q aiga en el grupo, aki te dejo mi codigo a ver si puedes ver q es lo q esta mal, o como lo debo aplicar:

Código PHP:
Ver original
  1. $registros=mysql_query("select * from invoicestemp where
  2. brodri='$_REQUEST[idtruck]' and date>='$_REQUEST[fechaini]'
  3. and date<='$_REQUEST[fechafin]' order by truck",$link);
  4. $num_registros=mysql_num_rows($registros);
  5. if ($num_registros==0)
  6.     {
  7.         echo "No Trucks Found";
  8.     }
  9.     else{
  10.            
  11.             while($fila=mysql_fetch_row($registros))
  12.             {
  13.                
  14.                 echo "
  15.                 <table width='100%' align='center'>
  16.                     <tr align='center'>
  17.                    <td width='8%'>".$fila[1]."</td>
  18.                    <td width='12%'>".$fila[3]."</td>
  19.                    <td width='5%'>".$fila[4]."</td>
  20.                    <td width='6%'>".$fila[5]."</td>
  21.                    <td width='12%'>".$fila[8]."</td>
  22.                    <td width='12%'>".$fila[9]."</td>
  23.                    <td width='6%'>".$fila[10]."</td>
  24.                    <td width='6%'>".$fila[11]."</td>
  25.                    <td width='6%'>";$amountpay=$fila[10]*$fila[11]; echo $amountpay."</td>
  26.                    <td width='6%'>";$percent=$percentage/100; $total=$percent*$amountpay; echo $total."</td>
  27.                     </tr>";
  28.             }
  29.         }
  30. ?>

con este codigo consigo q me muestre todos los camiones entre esas fechas, hice el group by with ROLLUP, pero como te digo solo me muestra un registros por grupo.