Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql_fetch_assoc() Issue
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/795746/warning-mysql-fetch-array-supplied-argument-is-not-a-valid-mysql-result">Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result</a> </p> </blockquote> <p>I'm getting this error message: </p> <blockquote> <p>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /.../.../..../index.php on line 215</p> </blockquote> <p><strong>Index.php code:</strong></p> <pre><code>if (isset($_GET['post_id']) &amp;&amp; $_GET['post_id'] != '') { $p_id = (int) $_GET['post_id']; $sql= mysql_query("SELECT * FROM news_post WHERE post_id = '$p_id' AND block = 0 LIMIT $offset, $rowsperpage") or mysql_error(); } else { $sql= mysql_query("SELECT * FROM news_post WHERE block = 0 ORDER BY post_id DESC LIMIT $offset, $rowsperpage ") or mysql_error(); } while ($rel = mysql_fetch_assoc($sql)) (Note: this is Line 215) { $id = intval($rel['post_id']); $sub = ucfirst($rel['subject']); $imgname = htmlentities($rel['img_name']); $img = htmlentities($rel ['image']); $msg = $rel['message']; $date = htmlentities($rel['date']); $poster = htmlentities($rel['poster']); $cat_id = intval($rel['cat_id']); $cat_name = htmlentities($rel['cat_name']); </code></pre> <p>In my Localhost, it's Ok, it's doesn't show any error message but when up this to my server then it's show error.. What is wrong in my code? can anyone tell me the right direction...<br> Thanks a lot.</p>
    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.
 

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