Oh wow, I had actually posted the wrong code in the first post. I had meant to post this:
Code:
SELECT ImageDate
, ImageName
, ThumbName
, ( SELECT MAX(ImageID)
FROM JamesTattoos
WHERE ImageDate < T.ImageDate ) AS prev_id
, ( SELECT MIN(ImageID)
FROM JamesTattoos
WHERE ImageDate > T.ImageDate ) AS next_id
FROM JamesTattoos as T
WHERE ImageID = 159
Which is code I had gotten from you r397. (Thanks worked brilliantly!)
Let me post a more simple version with some ID's actually in there. This does return results when tested in phpmyadmin.
PHP Code:
$query_rsNav = "SELECT ImageDate , ( SELECT MAX(ImageID) FROM PhotoGallery WHERE ImageDate < T.ImageDate ) AS next_id , ( SELECT MIN(ImageID) FROM PhotoGallery WHERE ImageDate > T.ImageDate ) AS Prev_id FROM PhotoGallery as T WHERE ImageID = 117 AND CatID = 1";
but when I try to output it with the following code nothing displays.
PHP Code:
<?php echo $row_rsNav['next_id']; ?>
<?php echo $row_rsNav['prev_id']; ?>
I'm a bit confused as to why when I test it there are results, but I can't output them.
Bookmarks