Hey,

I am trying to implement pagination on my PHP website to display images from a database and limit them to only show a certain amount of images per page..

Now i have been following this tutorial:-

http://net.tutsplus.com/tutorials/php/how-to-paginate-data-with-php/


I have the following code:-

PHP Code:
            <?php

            
include("paginator.php"); //Paginator class is within this file
        
            
$pages = new Paginator;  
            
$pages->items_total $num_rows[0];  
            
$pages->mid_range 9;  
            
$pages->paginate();  
            echo 
$pages->display_pages(); 
                           
            include(
"conn.php"); 
                                     
            
$query "SELECT image_name FROM images WHERE image_name != '' ORDER BY image_id ASC $pages->limit";
            
$result =  mysql_query ($query);
            
$row mysql_fetch_array($result,MYSQL_ASSOC);
            
            echo 
"<div><a href='images/$row[image_name]' rel='lightbox' title='$row[caption]'><img src='images/$row[image_name]' alt='' width='80' height='80'/></a><span>$row[caption]</span></div>";
            
            
mysql_close();    
            
?>
Now the code above has an include file "paginator.php" which includes the class given in the tutorial.

Now when it comes to displaying the fields from the database i am having trouble. I am receiving this error:-

PHP Code:
Warningmysql_fetch_array(): supplied argument is not a valid MySQL result resource in /domains/skindeepapparel.com/http/lou/gallery.php on line 90 
Can anyone help..

If not can you offer some other help in terms of pagination..

Regards