1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| <!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!--<script scr="jquery-2.0.3.js"></script>-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Mon premier document PHP</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<?php
$con=mysqli_connect("127.0.0.1:3306", "root", "", "hotel");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$pays = "SELECT DISTINCT country FROM hotelactif";
$city = "SELECT DISTINCT city FROM hotelactif";
$prix = "SELECT name FROM hotelactif WHERE highrate >= 100000 AND lowrate <= 100000";
$test = mysqli_query($con, $pays);
$listePays = "<select id='country' name='country '>";
while ($row=mysqli_fetch_array($test))
{
$paysSelect = $row['country'];
$listePays .= "<option value=".$paysSelect.">".$paysSelect."</option>";
}
$listePays .= "</select>";
// while($row = mysqli_fetch_array($test))
// {
// echo $row['country'];
// echo "<br>";
// }
mysqli_close($con);
?>
<form id=pays action='index.php' method='POST'>
<table>
<tr>
<td>
Test
</td>
<td>
<div><?php print $listePays; ?><button onclick="javascript:selectCountry()">Gaufre</button></div>
</td>
</tr>
</table>
</form>
<b><?php echo "Bonjour Helpclic" ?>
</b>
</body>
</html> |
Partager