Ver Mensaje Individual
  #17 (permalink)  
Antiguo 26/10/2011, 13:11
Avatar de tomark4
tomark4
 
Fecha de Ingreso: septiembre-2007
Mensajes: 154
Antigüedad: 16 años, 8 meses
Puntos: 29
Respuesta: formulario lista

codigo probado y funcionando
Código PHP:
Ver original
  1. <?php
  2. $server="localhost";
  3. $user = "root";
  4. $pass = "";
  5. $db = "aja";
  6. $ln = mysql_connect($server, $user, $pass) or die(mysql_error());
  7. $sql = "select * from lista";
  8. $rs = mysql_query($sql) or die(mysql_error);
  9. ?>
  10. <select name="lista">
  11. <?php
  12. while($row=mysql_fetch_array($rs))
  13. {
  14. ?>
  15.  <option value='<?php echo $row[0];?>'><?php echo $row[1];?></option>
  16. <?php
  17. }
  18. ?>
  19. </select>