Salis Posted July 26, 2007 Share Posted July 26, 2007 I'm working on my own forum for my gaming site. I need a lot of integrations and I'd rather make my own forum then mod the heck out of some one else's. I can do all the queries I need expect one. I need 1 query to read the boards then categories. Similar to this site. For an example: Welcome to the =Fire= Squad <- Board 1 General Chat <- Category 1 of Board 1 News & Events <- Category 2 of Board 1 =Fire= Squad Server <- Board 2 Dates & Times <- Category 1 of Board 2 This is what I started: ("SELECT * FROM sqd_boards LEFT JOIN sqd_categories.ID_Cat ON sqd_boards.ID_Board = sqd_categories.ID_Cat ORDER BY sqd_boards.Board_Sort ASC") As you can see it sorts the Boards but how can I also sort the Categories as well? Any ideas? Quote Link to comment Share on other sites More sharing options...
Illusion Posted July 27, 2007 Share Posted July 27, 2007 ORDER BY sqd_boards.Board_Sort,sqd_categories.ID_Cat ASC; It all depends the data in the two columns, it works fine as long as we don't have any records that contradicting each other. By default it keeps in ascending order but id doesn't matter even if u explicitly specify that one. Quote Link to comment Share on other sites More sharing options...
Salis Posted July 27, 2007 Author Share Posted July 27, 2007 It all depends the data in the two columns, it works fine as long as we don't have any records that contradicting each other. By default it keeps in ascending order but id doesn't matter even if u explicitly specify that one. Thanks. There shouldn't be. I'm just reading the board names then the categories. So far this was the only query I needed help on. I never knew you could order 2 tables this way. Thanks for your help Illusion. 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.