Please check what is wrong in this mysql query i am getting the following error : <p>I am getting the following error:<br>
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given
I tried to change the code but no use can any body help me please make this code workable.
My code is:</p>

<pre><code>&lt;?php
/*home page bannerrotator*/
$sql="SELECT homelb,bdetails1,bdetails2,abovefoo1,abovefoo2 FROM 
adsettings WHERE NOT(hview1=hometotal AND hview2=bdtotal1 AND  
hview3=bdtotal2 AND hview4=foototal1 AND hview5=foototal2) LIMIT 10";
$result=mysqli_query($connection,$sql);
$rows=mysqli_num_rows($result);
if($rows!=0)
{
$leaderboard = array();
$bd1=array();
$bd2=array();
$foo1=array();
$foo2=array();
$i=0;
while ($row = mysqli_fetch_assoc($result)) { 
$leaderboard[i]=$row['homelb'];
$bd1[i]=$row['bdetails1'];
$bd2[i]=$row['bdetails2'];
$foo1[i]=$row['abovefoo1'];
$foo2[i]=$row['abovefoo2'];
i++;
}
shuffle($leaderboard);
shuffle($bd2);
shuffle($bd1);
shuffle($foo1);
shuffle($foo2);
}
else
{
$leaderboard[0]="Advertise Here";
$bd1[0]="Advertise Here";
$bd2[0]="Advertise Here";
$foo1[0]="Advertise Here";
$foo2[0]="Advertise Here";
}
/*login page adverts*/

?&gt;
</code></pre>
