I recently noticed the UNION function and saw on W3Schools that you can unite two table, but I want to unite three... I have made up a piece of code, however it doesn't work because I get an error. Is it possible to unite three tables and how can I achieve this? Thanks!
ERROR:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Legendary\new\search.php on line 54
CODE:
// Fill up array with names
$sql2 = mysql_query("SELECT * FROM members UNION ALL SELECT * FROM clans UNION ALL SELECT * FROM tournaments");
while($row=mysql_fetch_array($sql2)) {
$a[]=$row['name'];
$b[]=$row['id'];
}