Hi, I need a little help. This might be something simple but hard for me. I am trying to list all the name of the product which is $description and the $quantity neatly by using a table.
My problem is that it is only showing one product information instead of all the product $description and $quantity that are in the database. This is the code I tried below. I thought to be smart and put a few <td> tags to see what will happen but it only repeated the same products.
echo "<h2>Current Items and Quantities:</h2>\n"; echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; $query = "SELECT description, quantity from products"; $result = mysql_query($query); $row = mysql_fetch_array($result, MYSQL_ASSOC); $description = $row['description']; $quantity = $row['quantity']; echo "<tr><td>$description</td><td>$quantity</td></tr>\n"; echo "</table>\n";