Hi Guys,
I am attempting to dynamically join two tables.
Table one: Catalogue
Table Two: Products
Each table has a column called "catName" so I can make the join accordingly. "SELECT products.catName, catalogue.catName where products.catName = catalogue.catName;
What I thought would be easy is turning out to be quite difficult.
I want to dispaly all products which reside under each catName.
There are 4 catNames which describe where a product fits in the catalogue. Instead of creating 4 select querys for each catName I want to create a looping code so it is easy to add new catNames on the fly.
so for example, to display this without using 4 select queries. I have tried coding a loop but just can't get it working.
CatName1
Product1 in This Category
Product2 in This Category
Product3 in This Category
CatName2
Product1 in This Category
Product2 in This Category
Product3 in This Category
CatName3
Product1 in This Category
Product2 in This Category
Product3 in This Category
CatName4
Product1 in This Category
Product2 in This Category
Product3 in This Category
//while (catalogue.catName == products.catName){
//display these products
//}
Just not sure...any hints would be great.
Cheers