Hi everyone!!

I have a mysql table of products and i want to group them by the category then each sub category in a table:

SQL strng:

SELECT `Product_Name` , `Product_Description` , `Product_Features` , `Product_picurl` , `Product_price` , `Product_Category` , `Product_subcat`
FROM `prod_listing`

Like this:

Acoustic Treatment
Acoustic panels
Studio amps

How can i do thisand still be able to see the table layout in dreamweaver?

thanks in advance

You can do that by using group by clause. select * from product_listing group by product_category; I dont know what you mean by >>still be able to see the table layout in dreamweaver << :S

i dont think you can view the table in dreamweaver once it is in the <?php ?> code.

you can arrange your output in any format you want.

//select db
$query="select * from product_listing group by product_category";
echo "<table>";
   echo "<tr><td>".$row['product_name']."</td><td>".$row['product_id']."</td></tr>";
echo "</table>";

This will put the values in a table of 2 columns. I don't understand what the code in your other thread do.