My tagging system uses two tables, tags and coupon_tags. The way it works is that each coupon and each tag is assigned a numerical value. So a coupon may have the id 13 and a tag may have the id 5, for example. coupon_tags makes a new row per coupon per tag, so it may look like so:
couponID | tagID
5 3
5 1
5 9
6 1
In the code I am working on, the couponID is known, and represented as the variable $coupID. I need help on the following: So what I would have to do is figure out all of the rows where couponID is, and pull all of those tagID's into an array, for example, $allTagIDs[], and then loop through that array and at each iteration, match the tagID to a tagName in the next table called tags (both tables have a tagID field, which is how I match them up). Those tags need to be put into an array as well.
Then for output, I'll just print_r($arrOfTagNames). I just don't know how to do what I wrote up there in PHP.