I have two tables
First one is categories and second one is products.
Categories table contains cat_id, cat_name, Cat_desc.
Products table contains product_id, product_name, Product_desc and cat_id
I want to display all categories as heading and list only 4 related products under each category heading.
For Eg:
Category1
Product 1, Product 2, product 3
Category 2
Product 4, product 5
How can I script this. I am newbie pls help
OK i think this is ok with your question. try this…
AND refer this http://php.net/manual/en/book.mysql.php