//connect to database $db = mysqli_connect('localhost','username','password','database_name'); //query to retrieve all products $query = "SELECT * FROM products"; //execute query $result = mysqli_query($db, $query); //iterate over result set and display product information while($row = mysqli_fetch_assoc($result)){ echo "Product Name: " . $row['product_name'] . "In the above example, we use the mysqli extension in PHP to connect to the database, execute a SELECT statement to retrieve all products from the "products" table and then loop through the result set to display the product information. The package/library used in this example is the mysqli extension which is included in the PHP core.
"; echo "Price: " . $row['price'] . "
"; echo "Description: " . $row['description'] . "
"; echo "
"; }