Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP/MySQL Error: Warning: mysql_fetch_assoc() expects parameter 1 to be resource
    primarykey
    data
    text
    <p>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.</p> <p>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.</p> <p>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</p> <p>Any ideas? As always thanks a bunch!</p> <p>Full Error:</p> <pre><code>Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/xxxxxx/public_html/includes/adverts/sidead1.php on line 5 </code></pre> <p>Part of the code below:</p> <pre><code>&lt;?php include '../includes/core/db/sidead1_dbinfo.php'; $ads = mysql_query("SELECT `advert_id1`, `title1`, `desc1`, `image1` FROM `sidead1` WHERE UNIX_TIMESTAMP() &lt; `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"); } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload