Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/04/2012, 14:46
dehost
 
Fecha de Ingreso: septiembre-2010
Mensajes: 53
Antigüedad: 13 años, 7 meses
Puntos: 4
De acuerdo Respuesta: Mostrar un array dividiendolo en varias partes

Código PHP:
Ver original
  1. <?php
  2.    // Connecto a db
  3.  mysql_connect("localhost", "usuario", "pasw") or die(mysql_error());
  4.  mysql_select_db("database") or die(mysql_error());
  5.  
  6.  // REcolecto los datos
  7.  $data = mysql_query("SELECT * FROM tabla") or die(mysql_error());
  8. ?>
  9.  
  10. <div style="float: left;  background-color: blue; height: 200px; width: 150px; overflow:auto;">
  11.  
  12. <?php  
  13.  //genero el array y hago un loop
  14.  
  15.  while($info = mysql_fetch_array($data))
  16.  {
  17.          Print "<div class='cuadrado'>";
  18.          Print "<b> ".$info['dato1'] . "</b><br/><br/>";
  19.          Print "<b> ".$info['dato2'] . "</b><br/><br/>";
  20.          Print "<b> ".$info['dato3'] . "</b><br/><br/>";
  21.          Print "</div>";
  22.  }
  23.  
  24.  
  25. ?>
  26.  
  27. </div>