SELECT photo_filename, photo_label, photo_id, photo_desc, photo_dateadded, album_id, photo_viewcnt, gallery_id
FROM photo_t
WHERE photo_id = #photonum#
AND album_id = #albumnum#
Sorry, the photo you requested does not belong to the album you requested or is no longer available.
SELECT album_label, album_photocnt, album_createdate, album_lastupdate
FROM album_t
WHERE album_id = #albumnum#
SELECT photo_rating_count, photo_rating_total
FROM photo_rating_t
WHERE photo_id = #photonum#
SELECT user_id
FROM gallery_t
WHERE gallery_id = '#getpic.gallery_id#'
SELECT user_fname, user_lname, user_email, user_city, user_state, user_country, user_display
FROM user_t
WHERE user_id = '#getuser1.user_id#'
UPDATE photo_t SET photo_viewcnt = photo_viewcnt + 1 WHERE photo_id = #photonum#
UPDATE photo_t SET photo_lastviewed = '#dateformat(now(),'yyyy-mm-dd')#' WHERE photo_id = #photonum#