Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>BuyingTransaction</title>
- </head>
- <body>
- <form action= "BuyingTransaction.php" method="post">
- <select class="form-dropdown" style="width:150px" id="input_5"
- name="ProductNames">
- </form>
- <?php
- $username="22243339";
- $password="X23CZw2X";
- $server="localhost";
- $database="DB_22243339";
- $sqlConnect = mysql_connect($server, $username, $password);
- // Check connection to the database
- if(!sqlConnect)
- {
- die('Could not connect: ' . mysqlerror());
- }
- mysqli_select_db($sqlConnect, $database);
- $filter = mysql_query("SELECT ProductName FROM Products", $sqlConnect);
- menu = "";
- while($row = mysql_fetch_array($filter))
- {
- $menu .="<option>" . $row['dropdown_option'] . "</option>";
- }
- // Close menu form
- $menu = "</select></form>";
- echo $menu;;
- mysqli_close(sqlConnect);
- ?>
- </select>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement