Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>BuyingTransaction</title>
  4. </head>
  5. <body>
  6. <form action= "BuyingTransaction.php" method="post">
  7. <select class="form-dropdown" style="width:150px" id="input_5"
  8. name="ProductNames">
  9. </form>
  10.  
  11. <?php
  12.  
  13. $username="22243339";
  14. $password="X23CZw2X";
  15. $server="localhost";
  16. $database="DB_22243339";
  17.  
  18.  
  19. $sqlConnect = mysql_connect($server, $username, $password);
  20.  
  21. // Check connection to the database
  22. if(!sqlConnect)
  23. {
  24. die('Could not connect: ' . mysqlerror());
  25. }
  26.  
  27. mysqli_select_db($sqlConnect, $database);
  28.  
  29.  
  30. $filter = mysql_query("SELECT ProductName FROM Products", $sqlConnect);
  31. menu = "";
  32. while($row = mysql_fetch_array($filter))
  33. {
  34. $menu .="<option>" . $row['dropdown_option'] . "</option>";
  35. }
  36. // Close menu form
  37. $menu = "</select></form>";
  38. echo $menu;;
  39. mysqli_close(sqlConnect);
  40. ?>
  41. </select>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement