Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [insert_php]
- $servername = "sql102.*******.com";
- $username = "b3_*******";
- $password = "********";
- // Create connection
- $conn = new mysqli($servername, $username, $password);
- // Check connection
- if ($conn->connect_error)
- {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- mysqli_select_db('b3_**********');
- $sql="SELECT City FROM Map_of_resellers";
- $result=mysqli_query($sql);
- if($result === FALSE)
- {
- die("Query failed: " . mysqli_error());
- }
- [/insert_php]
- <form name="Cities" method="post" >
- [insert_php]
- echo "<select name='City'>";
- while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC))
- {
- echo "<option value='" . $row['City'] ."'>" .
- $row['City']."</option>";
- }
- echo "</select>";
- [/insert_php]
- </form>
Add Comment
Please, Sign In to add comment