connect_error) { die("Connection failed: " . $conn->connect_error); } // Define the SQL query to fetch stock data $sql = "SELECT id, name, quantity FROM products"; // Execute the query and store the result $result = $conn->query($sql); // Close the database connection $conn->close(); ?>
| Product ID | Product Name | Quantity |
|---|---|---|
| " . $row["id"] . " | "; echo "" . $row["name"] . " | "; echo "" . $row["quantity"] . " | "; echo "
| No products found | ||