Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Building an index for next/last in a photo album.

by davidj (Priest)
on Jul 26, 2004 at 20:34 UTC ( [id://377569] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my ($img_id) = $str =~ m/img_id=(\d+)/;
    my $prev_id = $img_id - 1;
    my $next_id = $img_id + 1;
  2. or download this
    "select WHATEVER from TABLE where img_id in ($prev_id, $img_id, $next_