son Posted April 15, 2012 Share Posted April 15, 2012 I get data from db that holds info about category parents and sub-categories as $galleryCheckQuery = "SELECT imgID FROM table1 WHERE catID = $catID OR catID = (SELECT catID FROM table1 WHERE parent = $catID)"; Now I have the issue that this is not working when there are several sub-categories... What would be a good solution to this? Son Link to comment Share on other sites More sharing options...
son Posted April 16, 2012 Author Share Posted April 16, 2012 Got the answer! Gosh, recently my brain has really gone for a walk... The following does the trick: $galleryCheckQuery = "SELECT imgID FROM table1 WHERE catID = $catID OR catID IN (SELECT catID FROM table1 WHERE parent = $catID)"; Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.