Code per item in database

Solving Complex Problems Through Programming. This course is also called advanced programming.
Forum rules
Please be careful about sharing personal information. Never use any identifiable information.
Post Reply
User avatar
ianthecoolest
Helper!
Posts: 10
Joined: 23 May 2018, 14:34

Code per item in database

Post by ianthecoolest » 13 Mar 2019, 13:27

Hello! I have a SQL database filled with items. I'd like there to be a card for every item in that database. That means that if there are 5 database items, there will be 5 database cards. Additionally, I'd like each card to have the corresponding name, description, price, etc. as per the database item. Here is the example of a card:

Code: Select all

            <div class="col-lg-3 col-md-6 mb-4">
                <div class="card h-100">
                    <img class="card-img-top" src=<?php $img_from_database ?> alt="">
                    <div class="card-body">
                        <h4 class="card-title"><?php $name_from_database ?></h4>
                        <p class="card-text"><?php $description_from_database ?></p>
                    </div>
                    <div class="card-footer">
                        <a href="#" class="btn btn-primary">Find Out More!</a>
                    </div>
                </div>
            </div>
             
Take into account this code is only an example with a few variables, so don't mind the placeholders :D .
Thanks for your help in advance,
Hidden Content
This board requires you to be registered and logged-in to view hidden content.
1 x
:twisted:

Post Reply