I want to combine two queries to make them act as single query
there are NO unique columns in both the tables
My two queries
SELECT * from admin WHERE name != 'xyz'
Select goods from good_items where userid=$userid
with single query I am getting the results fine . but two queries combined i get this error
mysql_fetch_array() expects parameter 1 to be resource, boolean given in
I am combining the queries like this
$sqlofferadmin=mysql_query("SELECT name,task,prize from admin WHERE name != 'xyz'
UNION ALL
SELECT goods from good_items WHERE userid=$userid");
I want to display out like this
<?php
while($row = mysql_fetch_array($sqlofferadmin))
{
echo "<tr> ";
echo "<td>" .$row[name] . "</td>";
echo "<td> ".$row[task] . "</td>";
echo "<td>" .$row[goods] . " </td>";
}
echo "</tr> " ;
?>