I've read the other questions. The error has been posted before ofcourse. It's a common error. How/Why I am getting the errror is unique. Not a duplicate.
I know this error message has been posted on before but not with my specific set of complications. I have recently put a site together on my local server using xammp. Everything worked properly before on my local machine before i uploaded. I have encountered at-least 8 new problems after uploading to my web host but have been able to fix each one. 3 of which with the help of this site. I believe I will have it completed after this error is fixed.
The issue is with my advert rotating system. It's a very simple script/system. There are 4 database for the 4 separate places on the page i have the rotating adverts. this is the second one i am attempting to put on the live site. I've already got the first one working with no error. The error on this one is on line 5
Any ideas? As always thanks a bunch!
Full Error:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/xxxxxx/public_html/includes/adverts/sidead1.php on line 5
Part of the code below:
<?php
include '../includes/core/db/sidead1_dbinfo.php';
$ads = mysql_query("SELECT `advert_id1`, `title1`, `desc1`, `image1` FROM `sidead1` WHERE UNIX_TIMESTAMP() < `expires1` AND `shown1`=0 ORDER BY `advert_id1` ASC LIMIT 1");
while ($ads_row = mysql_fetch_assoc($ads)) {
$advert_id1 = $ads_row['advert_id1'];
$image1 = $ads_row['image1'];
$title1 = $ads_row['title1'];
$desc1 = $ads_row['desc1'];
mysql_query("UPDATE `sidead1` SET `shown1`=1, `impressions1`=`impressions1`+1 WHERE `advert_id1`=$advert_id1");
$shown1 = mysql_query("SELECT COUNT('advert_id1') FROM `sidead1` WHERE `shown1`=0");
if (mysql_result($shown1, 0) == 0) {
mysql_query("UPDATE `sidead1` SET `shown1`=0");
}
}
?>