![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
16/06/2010, 01:55
|
![Avatar de gran Wakka](http://static.forosdelweb.com/customavatars/avatar194220_1.gif) | | | Fecha de Ingreso: septiembre-2007
Mensajes: 712
Antigüedad: 17 años, 5 meses Puntos: 48 | |
Respuesta: Traer datos a un select con php Podría ser algo así:
Código:
<select name="localidad">
<?php
$sql="select codigo, nombre from localidad";
$cursor=mysql_query($sql,$conexion);
while ($datos=mysql_fetch_array($cursor)) {
?>
<option value="<?php echo $datos[0];?>"><?php echo $datos[1];?></option>
<?php
}
?>
</select>
|