im trying to echo a product list with all my my products, yet i have 3 products in mysql. but from some reason when i echo my list it shows only one product the first one the list. while i want to see all the products (3).
if this may be relevant i'm using: Server version: 5.5.36 - MySQL and [PHP: 5.4.27]
// This block grabs the whole list for viewing
include "../sitescripts/connect_to_mysql.php";
$product_list = "";
$sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC");
$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"]));
$product_list = "Product ID: $id - <strong>$product_name</strong> - $$price - <em>Added $date_added</em> <a href='inventory_edit.php?pid=$id'>edit</a> • <a href='inventory_list.php?deleteid=$id'>delete</a><br />";
}
} else {
$product_list = "You have no products listed in your store yet";
}