Hi, I am making my first eCommerce site and am having trouble understanding how to pull my dynamic list data into a three column table so like | pic | pic | pic | I have tried everything I can think of, and I imagine the answer is simple as always. Thanks for any help, it is much appreciated! here is the code I am using:
[php]<?php
include “storescripts/connect_to_mysql.php”;
$dynamicList = ‘’;
$sql = mysql_query(“SELECT * FROM products ORDER BY date_added DESC LIMIT 16”);
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$id = $row[“id”];
$product_name = $row[“product_name”];
$price = $row[“price”];
$date_added = strftime("%b %d, %Y", strtotime($row[“date_added”]));
$dynamicList .= ’
’ . $product_name . ’ £’ . $price . ’ More Info |
}
} else {
$dynamicList = “We have no products listed in our store yet”;
}
mysql_close();
?>[/php]