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: Select all
$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