Guest User

Untitled

a guest
Nov 27th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ALL);
  5. $servername = "localhost";
  6. $username = "root";
  7. $password = "123456789";
  8. $dbname = "shopdb";
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13. $sql = "SELECT category FROM good ";
  14. $result = $conn->query($sql);
  15. echo "category: ";
  16. while($row = $result->fetch_assoc()) {
  17. echo "<button>$row[category]</button>" ;
  18. }
  19. $conn->close();
  20. ?>
Add Comment
Please, Sign In to add comment