i have a query with 3 union selects:

   SELECT id, 'news' AS type, .... FROM news

   UNION
SELECT id, 'faq' AS type, .... FROM faq

   UNION

   SELECT id, 'forum' AS type, .... FROM forum

which works just fine and selects everything from all 3 tables.. but say i want to make a condition to only select from either 'faq' , 'news' or 'forum' how can i do this?

example, if a user visits a link suck as: page.php?cat=faq it will only select from 'faq' .. is this possible to do right in the query? when there is no ?cat= then all three selects run.

makes sense? i am stuck on this for a few days already.
thanks.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to