Jump to content

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result


NealeWeb

Recommended Posts

I am simply trying to display the last 8 images from a mysql database and i am getting this error:

 

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/aretheyh/public_html/nealeweb.com/gnew2/recent.php on line 8

 

Can somebody please tell me what i am doing wrong.

 

<?php
$i = 1;
echo '<table border="0" cellpadding="0" cellspacing="0">
<tr>';
include("config.inc.php"); 

        $result =  mysql_query("SELECT * FROM gallery_photos ORDER BY id DESC LIMIT 8"); 
        while($row = mysql_fetch_assoc($result)) { // Start of the loop 
        $img = $row['".$images_dir."/tb_']; 

echo "<td><img src=$img></td>"; 

if ($i == 4) {
echo '</tr><tr>';
}

$i++;
}
echo '</tr></table>'; 

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.