hi,
this is my first time posting to this forum...i tried a keyword search but apparently the search is down...
my question is that in my database there are two tables called halogenproduct and cflproduct..
now on the index page for the site, there is a drop down box which lists the total number of distinct watts in both tables...
my question is how do i get the distinct watts from the halogenproduct table AND the distinct watts from the cflproduct table keeping in mind that the wattages should not overlap...
my query in php is...
i tried using the union operator like there is in sql but to no avail...
can someone please help me out?
thanks alot,
arif
X-) s-)
this is my first time posting to this forum...i tried a keyword search but apparently the search is down...
my question is that in my database there are two tables called halogenproduct and cflproduct..
now on the index page for the site, there is a drop down box which lists the total number of distinct watts in both tables...
my question is how do i get the distinct watts from the halogenproduct table AND the distinct watts from the cflproduct table keeping in mind that the wattages should not overlap...
my query in php is...
Code:
<select>
<option value="" selected>--Select--</option>
<?
$sql= "select distinct halogenproduct.watts, cflproduct.watts from halogenproduct, cflproduct where halogenproduct.watts <> cflproduct.watts";
$result = mysql_query ($sql);
while ($row = mysql_fetch_array($result)) {
extract($row);
?>
<option value="<? print $watts; ?>"><? print $watts; ?></option>
<?
}
?>
</select>
i tried using the union operator like there is in sql but to no avail...
can someone please help me out?
thanks alot,
arif
X-) s-)