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 Stock

Product Stock

num_rows > 0) { // Output data for each row while ($row = $result->fetch_assoc()) { echo ""; echo ""; echo ""; echo ""; echo ""; } } else { echo ""; } ?>
Product ID Product Name Quantity
" . $row["id"] . "" . $row["name"] . "" . $row["quantity"] . "
No products found