I have a two table table_a
and table_b
, table_a has a field a
and table_b has a field b
.
a b
1 3
2 4
3 5
4 6
I have been written below sql & php code
$query = "select * from table_a FULL OUTER JOIN table_b on table_a.a = table_b.b";
$result = $conn->query($query);
while($row = $result->fetch_assoc()){ //this is 38 number line
echo "<pre>";
print_r($row);
echo "</pre>";
}
It's giving me below error
Fatal error: Call to a member function fetch_assoc() on a non-object in C:\xampp\htdocs\sql\index.php on line 38
I am not finding any error here. If I use inner join here it's showing me result correctly.