Ive got a list of checkboxes. Each one is a unique keyword. There can be multiple keywords per Subroup but a keyword can only be associated with one subgroup.
etc... Each Subgroup is associated with several Groups
So, in other words, keyword A would be associated with Group A and Group B via Subgroup A. Keyword E, on the other hand, which is associated with Subgroup B would also be associated with Group B but also associated with Group C
A person may select A, B, or A and B (as well as any or all of the keywords but I\'m limiting this example to keep it simple). Therefore their choice. depending upon which keyword(s) selected could be associated with Group A and B, or Group B and C, or A, B, and C.
In most, one would select keywords only under a single Subgroup but they are not limited to soing so.
Upon selecting keywords and clicking on submit, I want to bring up a page with a list of only those Groups associated with the selected keywords (I need to limit the number of groups because, while there are perhaps 75 keywords and fewer than 10 subgroups, there are thousands of Groups. The Groups will have check boxes and will be in columns.
In other words, after all is said and done, someone will have chosen a list of keywords and a list of groups. The subgroup selected are implicit since a keyword can must be associated with a single subgroup.
Here are my tables and relevant fields:
keywords: k.keywordid, k.name, k.subgroupid
group: g.subgroupid, g.name
MY MySQL PROBLEM IS THIS:
I need to pass the list of all keywords selected on to the second page and then again on to a third. I know I want to select g.name from group from each row where g.subgroupid equals k.subgroupid.
Since they will typically select several keywords under a given subgroup, this means that I will be pulling up the same subgroup, and by relationship, group, several times.
So I want to eliminate duplicates before printing and then passing on names to the next page.
Of course I will be passing both a list of keywords selected and Groups selected along to the next page whereupon additional information will be collected and everthing thereafter stored into the appropriate tables.[/b]
I know someone can help me with this
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users