Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [![<?php
- $servername = "localhost";
- $username = "venividivici2016";
- $password = "4XDjhDFsxBtbxRsw";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- } else {
- }
- echo '<br/>';
- $bd_seleccionada = mysqli_select_db($conn,"veniviajes");
- if (!$bd_seleccionada) {
- die("Conecion fallida: " . mysqli_error($conn));
- } else {
- }
- $sentencia= " SELECT nombre FROM pais";
- if(!$sentencia)
- die("Error: no se pudo realizar la consulta");
- $resultado = mysqli_query($conn,$sentencia);
- if(!$resultado)
- die("Error: no se pudo realizar la consulta");
- ?>
- <select>
- <option value="">Seleccione</option>
- <?php
- while($fila=mysqli_fetch_array($resultado)){
- ?>
- <option value="<?php echo $fila[nombre]; ?></option>
- <?php } ?>
- </select>]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement