here's the thing, if I do just the first select it works perfect, but when I do the UNION it echoes Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\bla, bla, bla.
I did a searched for similar question and/or problem but none of the found seemed to give me a clue of how to fix this.
<?php
$moncols='col1,col2,col3,col4';
$main = "SELECT $moncols FROM table1 WHERE col4 = 'yes'
UNION
SELECT $moncols FROM table2 WHERE col4 = 'yes'
UNION
SELECT $moncols FROM table3 WHERE col4 = 'yes'
UNION
SELECT $moncols FROM table4 WHERE col4 = 'yes'
UNION
SELECT $moncols FROM table5 WHERE col4 = 'yes'";
$resoult = $mon -> query($main);
while ($row = mysqli_fetch_assoc($resoult)){
$myStuff=$row['col4'];
$otherStuff=$row['col3'];
echo $myStuff. ' - ' .$otherStuff. '<br>';
}
?>
Than's :)