join or union?
Posted: Fri Jan 28, 2005 9:03 am
or how does it work. i've been searching and searching.
I basically need the output for a query like this (but this one doesn't exist of course):
How do I do this?
This is the function I'm using:
I basically need the output for a query like this (but this one doesn't exist of course):
Code: Select all
SELECT
ID,
naam
FROM
menu_een,
menu_tweeThis is the function I'm using:
Code: Select all
function returnAllMenuItems() {
$sql = "SELECT
ID,
naam
FROM
menu_een,
menu_twee
";
$result = mysql_query($sql);
if (!$result) {
return FALSE;
} else {
$i = 0;
while ($menu = mysql_fetch_array($result)) {
$returnї$i]ї'ID'] = $menuї'ID'];
$returnї$i]ї'naam'] = $menuї'naam'];
}
return $return;
}
}