Hi All
I have made a photo album.currently the photos are displayed like the following way in (pic.php):
Picture 1 Picture 2 Picture 3
(ID=1,Pos=1) (ID=2,Pos2) (ID=3,Pos=3)
Picture 4 Picture 5 Picture 6
(ID=4,Pos=4) (ID=5,Pos5) (ID=6,Pos=6)
Picture 7 Picture 8 Picture 9
(ID=7,Pos=7) (ID=8,Pos8) (ID=9,Pos=9)
Now if I click say Picture 5 then its showing in another page(viewpic.php).
Now in viewpic.php I want to display the photos in this way:
Picture 3 Picture 4 Picture 5 Picture 6 Picture 7
Picture 5
I am getting the position of each pic from mysql by this query
[code=php]$s=”select count(pic_id) as p from album where pic_id<=’$pic_id'”;
and in viewpic.php I have made a if else condition like
if($pos==1)
{
$sp=1;//start position of the row
$ep=5;//end position of the row
}
else
{
$sp=$pos-2;
$ep=$pos+2;
}
and running this query to make the above display
[code=php]$s1=”select * from album limit $sp,$ep “;
But this is not working at all….
Could you please tell me what should I do now….I am close to the display but not happening to my satisfaction.
Thanks in advance for your co-operation….Raj