17/10/2015, 12:06
|
| | Fecha de Ingreso: octubre-2015 Ubicación: cali
Mensajes: 1
Antigüedad: 9 años, 3 meses Puntos: 0 | |
problemas php, mysql html select option Buenos dias
Tengo un problema con una extraccion de datos desde una tabla creada en mysql para un select option en html
por favor me colaboran, la vdd no se que tengo mal y llevo varias horas dandole a esto
Codigo:
<?
$con=mysqli_connect("localhost","root","","prueba" ) or
die("Problemas con la conexión a la base de datos");
$sql= "select ID_CIUDAD, CIUDAD from ciudades order by CIUDAD";
$res=mysql_query($sql);
?>
<html>
<head>
<meta http-equiv ="Content-Type" content="text/html; charset=UTF.8">
</head>
<body>
INGRESE LA CIUDAD DE UBICACION
<select name="Ciudad">
<option value="">SELECCIONAR</option>
<?
while($fila=mysqli_fetch_array($res)){
echo"<option value=' ".$fila['0']." '>".$fila['1']."</option>";
}
?>
</select>
</body>
</html> |