Forum Moderators: coopster
$querysearch = mysql_query("
(SELECT id, 'Content' AS result, ...)
UNION
(SELECT id, 'Files' AS result, ...)
UNION
(SELECT postid, 'Categories' AS result, ...)
");
when $_GET['foo'] is either 'Content', 'Files, or 'Categories' i want just the results for that union, but when no $_GET['foo'] is present do the union on all 3 tables..as shown above. how can i do this?
thanks for any help.
if (!isset [php.net]($_GET['foo'])) {
$querysearch = mysql_query("
(SELECT id, 'Content' AS result, ...)
UNION
(SELECT id, 'Files' AS result, ...)
UNION
(SELECT postid, 'Categories' AS result, ...)
");
}