I don't know what is wrong with my code. supposingly, it should be populating all the items that I have in my database(id) however, it just tell me how many item I have in my database instead of listing out all the ids of products that I have in my database
Can someone help to pointed out my mistakes? I'm following a tutorial on youtube on making the shopping cart.
<?php
$product_list = "";
$sql = mysql_query("SELECT * FROM supermarket");
$productCount = mysql_num_rows($sql);//count output amount
if($productCount > 0){
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$product_list = "$id<br>";
}
}
else{
$product_list = "You have no products listed in your store yet";
}
?>