Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/02/2011, 07:03
arros
 
Fecha de Ingreso: noviembre-2009
Mensajes: 535
Antigüedad: 14 años, 6 meses
Puntos: 25
Respuesta: Ayuda con foreach por favorrr

prueba esto:
Código PHP:
Ver original
  1. <?php
  2.  
  3. $conexion = mysql_connect("localhost","","");
  4.  
  5. $sql = "SELECT
  6. clientes.id_cliente,
  7. cot_interna.item
  8. FROM cot_interna,clientes
  9. WHERE clientes.id_cliente=cot_interna.id_cliente_int
  10. ORDER BY cot_interna.id_cliente_int desc LIMIT 10";
  11.  
  12.  
  13. $consulta = mysql_query($sql,$conexion);
  14.  
  15. while($row = mysql_fetch_array($ql)){
  16.     $item = $row['item'];
  17.    
  18.       foreach($item as $k){
  19. echo '<td> id_cliente: '.$row['id_cliente'][$k].'</br></td>';
  20. echo '<td>item: '.$k.'</br></td>';    
  21.  
  22.    
  23.     }
  24. }
  25.        
  26. ?>