
March 8th, 2003, 08:22 PM
|
|
5B's
|
|
Join Date: Oct 2002
Location: PC, FL
Posts: 364
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
|
|
|
possible problem using array functions
Since I got my pet Rabbits a few months back I decided to build my own image gallery and I have a few questions.
my plan is to have 2 pics for each set of pictures. One small thumbnail and 1 large image. when the user clicks the thumbnail image I am going to use a typical image gallery layout and allow the user to click on to the next image. Well I am curious on how to do this. I could select * from images where user = $user but as far as creating the href to go on to the next image,....will this work?
PHP Code:
$images = mysql_query("select * from images where user_id = '$user_id'");
$image = mysql_fetch_array($images);
echo "<a href='foo.php?image_id=" . next($image['image_id']);
or
echo "<a href='foo.php?image_id=" . prev($image['image_id']);
and if this is ok to do,...what happens / how do you know,...when you reach the end of the array?
I hope I conveyed my concerns cleary enough
TIA
__________________
-- Jason
Last edited by Taelo : March 8th, 2003 at 08:48 PM.
|