Crustyfur Posted August 14, 2008 Share Posted August 14, 2008 Hi, Having problem get the nested query working and could use some help. I know that GROUP BY is probably causing the issue but I am not sure how to work around it. SELECT s.subcatid, s.subcategory, c.catid, p.catid, p.subcatid, p.active FROM tt_gear_subcategory s, tt_gear_category c, tt_gear_product p WHERE s.subcatid = p.subcatid AND c.catid = p.catid AND p.catid = '$catid' AND p.active = '1' GROUP BY s.subcatid ORDER BY s.subcategory ASC Second Query: $subcatid = $row["p.subcatid"]; $result2 = $db->sql_query("SELECT catid, subcatid, manfid, active FROM tt_gear_product WHERE catid = '$catid' AND subcatid = '$subcatid' AND active = '1' GROUP BY manfid"); Quote Link to comment Share on other sites More sharing options...
fenway Posted August 14, 2008 Share Posted August 14, 2008 Not sure what you're trying to do here... seems like you could do it all at once, with a JOIN... but you're returning non-GROUP BY'ed columns in the first query. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.