Thanks to R937 for helping out with the DB query, ive managed to add to the response slightly... however now im not too sure about how to approach this from a PHP angle

I have the following DB query:

Code:
SELECT movie.id
     , movie.title
     , genres
     , genreids
  FROM movie
INNER
  JOIN series
    ON series.id = movie.seriesid
INNER
  JOIN studio
    ON studio.id = movie.studioid
INNER
  JOIN (
       SELECT moviegenre.movieid
            , GROUP_CONCAT(genre.genrename ORDER BY genre.genrename SEPARATOR ', ') as genres
         FROM moviegenre
       INNER
         JOIN genre
           ON genre.id = moviegenre.genreid
       GROUP
           BY moviegenre.movieid
       ) as mg
    ON mg.movieid = movie.id
INNER
  JOIN (
       SELECT moviegenre.movieid
            , GROUP_CONCAT(genre.id ORDER BY genre.genrename SEPARATOR ', ') as genreids
         FROM moviegenre
       INNER
         JOIN genre
           ON genre.id = moviegenre.genreid
       GROUP
           BY moviegenre.movieid
       ) as mgid
    ON mgid.movieid = movie.id
ORDER BY title
Which returns the following:

+----+--------+----------------------------+------------+--------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| id | xid | title | pubdate | genres | genreids |
+----+--------+----------------------------+------------+--------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| 28 | xx101 | xx101 - test | 2007-01-10 | Action, Comedy, Thriller | 21, 23, 15

Now....the tricky bit For each movie that is returned, i need to display with its lists of genres. But i need these genre's to be links, so if a user clicks on it it redefines the search to only display movies that contain that genre.

Am ok with doing the post's etc, its just returning these as individual variables, that can then link to its corresponding 'genreid'...

Can anyone point me in the right direction? Would explode be the right way to go? Am using Smarty...not sure if theres any easy(er) way to do this...

Any help is appreciated, cheers