Hi Team
I want to reduce div card size, so that each div card will have its own div card as in a row 4. Then another row have div card with details 4. Currently their images and div card are fillng up the whole page as list.
// php code
PHP
// Display the products
$stmt = $pdo->query("SELECT * FROM products");
$products = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach ($products as $product) {
$productID = $product['id'];
$productName = $product['product_name'];
$productPrice = $product['product_price'];
$productImage = $product['product_image'];
// Start a Bootstrap card i neeed to reduce them here on div card.
echo "
$productName
Price: $productPrice
";
Mohamed Azarudeen ZRank #297 · 8.5K reputationPosted Jun 12, 2023, 12:22 PM EDT
Try this
// php code // Display the products $stmt = $pdo->query("SELECT * FROM products"); $products = $stmt->fetchAll(PDO::FETCH_ASSOC); // Start the row container echo ""; // Iterate over the products foreach ($products as $product) { $productID = $product['id']; $productName = $product['product_name']; $productPrice = $product['product_price']; $productImage = $product['product_image']; // Start a Bootstrap card with a column class echo " $productName Price: $productPrice "; } // Close the row container echo " ";