Couldn't you just test "page.php?cat=faq" with an if-then-else?
Depending on what is the GET variable you then can change the SQL, easy
w/PHP. 


On Sat, 04 Jun 2005 14:15:40 -0400, "Sebastian"
<[EMAIL PROTECTED]> said:
> 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]
> 

-- 
http://www.fastmail.fm - Faster than the air-speed velocity of an
                          unladen european swallow


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

Reply via email to