Thanks Maxpup - the following script worked, except it does not stop at the end, it continues on randomly pulling things from the database (items, calendars, but not images)
Here is the edited script that works -
<meta http-equiv="refresh" content="5;url=slideshow.php?id=<? echo "$rown"; ?>">
Here is the query running prior to the refresh -
$query = "SELECT id FROM images WHERE category = '$category' AND id > $id AND approve != 2 ORDER BY id ASC LIMIT 1" ; // For Previous
$result = mysql_query($query);
$numrows2 = @mysql_num_rows($result);
$rown = @mysql_result($result,0);
$query2 = "SELECT id FROM images WHERE id < $id ORDER BY ASC LIMIT 1"; // For next Record
If you want to take a look at what is happening, the last image is id-1056
But I'll send you to id - 1054 so you can see what I mean, everything after 1056 is not images they belong to items for sale, such as clothes, calendars, etc...
http://ushotbabes.com/slideshow.php?id=1054