genzedu777 Posted November 7, 2010 Share Posted November 7, 2010 Hi guys, I will really need your help of how I should structure my codes. Attached is the explanation. Thank you WIlson [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/218002-sql-help-needed/ Share on other sites More sharing options...
fenway Posted November 12, 2010 Share Posted November 12, 2010 No one's going to open a ~800kB word document -- try to summarize you question and post it directly into this thread. Quote Link to comment https://forums.phpfreaks.com/topic/218002-sql-help-needed/#findComment-1133564 Share on other sites More sharing options...
gizmola Posted November 12, 2010 Share Posted November 12, 2010 I went ahead and looked at the document you provided. Your structure is correct. subject_level is a classic Many to Many relationship resolver table, resolving the many to many relationship between subject and level. What I would recommend for your queries supporting the forms you're generating, is that you join the tables together using a standard inner join. You can then order result by level. As you loop through the result set, you simply set an outer variable on level. Anytime the level in the result set changes, you would emit a new section with the level heading and a new set of checkboxes. I would go so far as to say that you should take the same approach in your prior code, where you are instead doing 2 queries. That is not necessary, as joining the tables together will get you everything you need in one. If you need the results for only one level, you can always include that in the WHERE clause for the query. If you have any specific questions in regards to your coding, feel free to post them in a followup. Quote Link to comment https://forums.phpfreaks.com/topic/218002-sql-help-needed/#findComment-1133584 Share on other sites More sharing options...
genzedu777 Posted November 13, 2010 Author Share Posted November 13, 2010 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/218002-sql-help-needed/#findComment-1133770 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.