Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);
- $servername = "localhost";
- $username = "root";
- $password = "123456789";
- $dbname = "shopdb";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT category FROM good ";
- $result = $conn->query($sql);
- echo "category: ";
- while($row = $result->fetch_assoc()) {
- echo "<button>$row[category]</button>" ;
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment