trying to create thumbnail gallery.....plz hlp

A

Anonymous

Guest
ok, im just trying to create a thumbnail gallery really.
Im trying to get it working with one image first,

I have set up a db called "Kriminalyouth"
it has two tables "thumbnails" and "Images"

images contains = Picture_ID, Picture_Area, Picture_Path
thumbnails contains = Thum_ID, Thum_Area, Thum_Path

I have set up an images and thums folder in "htdocs" with one image in each. Vase.jpg in images and vasethum.jpg in thums.

Basically im not really sure where to start with the code to make this thumbnail work.

I would really appreciate some ideas, and anny help......im still learning.
Many Thanks People.

GAT.
 
just some extra stuff.

Picture_id and thum_id are primary keys.

picture_path = "C:\Program Files\Apache Group\Apache\htdocs\images\vase.jpg"

is that right for now?

could someone do a bit of code possibly?
I have no idea where to start.
 
you do not want to have the FULL path. People cannot use that via the web. You need the path as it would appear from the web. i.e. images/vase.jpg and forget the rest.

Becasue both the Picture_id and the Thumb_id may not always be the same you will need to add a foreign key in one or each of the tables to reference what Thumb_id goes with which Picture_id.

images contains = Picture_ID, Thum_ID, Picture_Area, Picture_Path
thumbnails contains = Thum_ID, Picture_ID, Thum_Area, Thum_Path

so if you want to get a list of thumnails and want it to create a link to display the full picture you would use this code.
Code:
$query = 'select thumbnails.Thum_Path, images.Picture_Path  from thumbnails, images where images.Picture_ID = thumbnails.Picture_ID';
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{

echo '<a href="'.$row['Picture_Path'].'"><img src="'.$row['Thum_Path'].'" border="0"></a><br>';
}

It's pretty simple code. Hope it helps a lil

}
 
Back
Top