Hey guys,
I'm trying to sort out a bit of banner coding. What i'm trying to do is:
1: Run banner selection code.
2: If height of banner is less than 300, run banner selection code again.
3: Ensure that the second run of selection code does not select the same banner.
The code that I have is:
list($height,$filename,$html,$bannerid) = banner();
$updatequery = "UPDATE banners SET impressions=impressions+1 WHERE id=$bannerid";
$updateresult = mysql_query($updatequery,$db) or die('4th');
echo "$html";
if ($height<="300")
{
while($filename!=$filename2)
{
echo "$i";
list(,$filename2,$html2,$bannerid2) = banner();
$i++;
}
echo "$html2";
$updatequery = "UPDATE banners SET impressions=impressions+1 WHERE id=$bannerid2";
$updateresult = mysql_query($updatequery,$db) or die('4th');
}
But its displaying the same banner twice (all the time).
Has anyone any hints as to what i am doing wrong?
Thanks, Leigh