I’m working on an e-commerce site for a client of mine. I’m building a mysql product database and want to retrieve the info from the database via php and then format for html so my css style sheet can be applied.
Currently, I’m hard-coding all of the products as such:
That’s the code for 1 product listed on a single page. This site has over 400 products spread over 10 pages and some of them appear on multiple pages. Since they’re currently hard-coded, it’s a nightmare when updating, adding, and removing products. I’d like to be able to run a query like “select * from products_master where solid = 1 and date_removed is null; order by title”
Fields I need to build the code above and can pull from the database are as follows: image (stored as image location such as “images/cb361.gif”), price (stored as double-decimal such as “12.00”), title (stored as product title such as “Dreaming of Palm Trees”), description (self explanatory), and button (stored as the google add-to-cart button).
How would I do this in php code, nested inside a div tag, within an html document?
Need to get to this format:
…is this possible with php? if so, can someone please help? Thanks in advance for any and all replies.