Jump to content

Invalid Reesource


jedney

Recommended Posts

I am tyring to do some PHP code, and I have run into an error.  The code looks fine, but I am new to PHP.  Any help?

 

<?    // DISPLAY NAVIGATION INFORMATION 
    $query = "SELECT * FROM news LIMIT 5 DESC"; 
    $result = mysql_query($query); 
    while ($row = mysql_fetch_array($result)) {
    echo "". $row["url"] .""; echo "</td>";
      echo "</tr>";
      echo "<tr>";
        echo "<td class=\"copyright\">Posted on ". $row["date"] ." at ". $row["time"] ." by ". $row["author"] ."</td>";
      echo "</tr>";
      echo "<tr>";
        echo "<td class=\"norm\">". $row["content"] ."</td>"; }
	?>

 

The error is this line:

while ($row = mysql_fetch_array($result)) {

 

Thank you!!

 

-Jon

Link to comment
https://forums.phpfreaks.com/topic/90915-invalid-reesource/
Share on other sites

try this and see if you get an error...

 

I am tyring to do some PHP code, and I have run into an error.  The code looks fine, but I am new to PHP.  Any help?

 

<?    // DISPLAY NAVIGATION INFORMATION 
    $query = "SELECT * FROM news LIMIT 5 DESC"; 
    $result = mysql_query($query) or die(mysql_error()); 
    while ($row = mysql_fetch_array($result)) {
    echo "". $row["url"] .""; echo "</td>";
      echo "</tr>";
      echo "<tr>";
        echo "<td class=\"copyright\">Posted on ". $row["date"] ." at ". $row["time"] ." by ". $row["author"] ."</td>";
      echo "</tr>";
      echo "<tr>";
        echo "<td class=\"norm\">". $row["content"] ."</td>"; }
	?>

 

The error is this line:

while ($row = mysql_fetch_array($result)) {

 

Thank you!!

 

-Jon

Link to comment
https://forums.phpfreaks.com/topic/90915-invalid-reesource/#findComment-465935
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.