Jump to content

Warning: mysql_fetch_row():


xyn

Recommended Posts

Hey.
I have this error:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/eumod/public_html/en/index.php on line 96

and line 96:
while( $data = mysql_fetch_row($sql))
      {

code:
[code=php:0]<?PHP
include("db/db.php");
$sql = mysql_query("SELECT * FROM news WHERE news_old='n' ORDER BY id DESC");
              while( $data = mysql_fetch_row($sql))
              {
              $sql2 = mysql_query("SELECT * FROM comments WHERE news_id='".$data[0]."'");
              $num = mysql_num_rows($sql2);
             
              echo '<div align="left">
  <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="90%">
    <tr>
      <td width="100%" colspan="2"><i><b>'.$data[1].'</b></i></td>
    </tr>
    <tr>
      <td width="100%" colspan="2">'.$data[2].'</td>
    </tr>
    <tr>
      <td width="100%" colspan="2">
      <hr color="#AAD2FF" width="95%" align="left" style="border: 1px dotted #AAD2FF" size="1">
      </td>
    </tr>
    <tr>
      <td width="50%">[ '.$data[6].' | '.$data[4].' : '.$data[5].' ]</td>
      <td width="50%">
      <p align="right"><b>'.$num.'</b> <a href="#top">Comments</a> | <a href="#top">
      Read more</a>...</td>
    </tr>
  </table>
</div>
<br>';
}
              ?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/17033-warning-mysql_fetch_row/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.