Ver Mensaje Individual
  #21 (permalink)  
Antiguo 12/07/2012, 05:36
malcom1881
 
Fecha de Ingreso: julio-2012
Mensajes: 16
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: select desplegable con PHP

topo bionico aquí está el código tal y como lo tengo

Código HTML:
Ver original
  1. <?PHP $conexion=conectarDB(); ?>
  2. <form ID="insertar" name="insertar" method="POST" action="insertar.php"  >
  3. Emplazamiento:
  4. <select name="emplaza">
  5. <?PHP
  6. include ('acceso.php');
  7. $sql = "SELECT * FROM emplazamiento";
  8. $result = mysql_query($sql,$conexion) or die(mysql_error());
  9. if ($result) {
  10.     while ($datos = mysql_fetch_row($result)) {
  11.         echo '<option value="'.$datos[0].'">'.$datos[0].'</option>';
  12.     }
  13.  mysql_free_result($result);
  14. }
  15. ?>
  16.  
  17.  
  18. </select>
  19. Item :<input type="text" name="item" value="" size="18" maxlengh="18"/> <br />
  20. <input type="submit" value="Cargar" name="SUBMIT" />
  21.  
  22. </form>
  23. </body>
  24. </html>