Heading --->Category
Subheading --->Subcategory
Store ----->Store Name
Subheading--->Subcategory
Store------>Store Name
Basically it lists the main selected category with the relevant subcategories and stores assocaited with them within a loop. Now I've got this working using a LEFT Join within my query. The columns counter allows the stores to be displayed in 4 columns. However, each subcategory has one store in it. I want to be able to have stores appear in multiple subcategories. What is the best way of doing this? I was thinking of a lookup table (subcategories_to_stores) but how do I set it up to work with the query? Or is there another better way of doing this?
Code:
$result = mysql_query("SELECT s.subcatName, s.store_name, s.thumb_nail FROM subcategory s LEFT JOIN store s s.msubcid = s.subcid WHERE cid='$categorytarget' AND active='1' ORDER BY s.subcatName ASC") or die("SELECT error: " . mysql_error());
Bookmarks