Hello everyone,
I'm not very good with php coding, so I'm asking for help please...
I would like to place the output of the following code into a neat table because at the moment it looks very untidy:
I know I have to place a table after $product_list .= but I just get errors when I do. Could someone please point me in the right direction here? Any help would be much appreciated.HTML Code:// This block grabs the whole list for viewing $product_list = ""; $sql = mysql_query("SELECT * FROM products ORDER BY category DESC"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $product_name = $row["product_name"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $product_list .= "Category: $category | Subcategory: $subcategory | <strong>$product_name</strong> | $price | <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"; }


Reply With Quote



Bookmarks