Hi All
I'm trying to create thumbnails on the fly using the gd library. I'm looping through images stored in a database and create thumbnails from these images. However, I can't get this to work. When I explicity type in the name of the image it works.
This is my code....
$result = mysql_query("SELECT * FROM pictures
INNER JOIN pics_in_albums
ON pictures.ID = pics_in_albums.PicID
INNER JOIN albums
ON pics_in_albums.AlbumID = albums.ID
WHERE albums.ID = 1") or die(mysql_error());
$paths = array();
$counter = 0;
//fetch tha data from the database
while ($row = mysql_fetch_assoc($result))
{
$currentImage = "images//" . substr(strrchr($row['Path'],92),1);
$counter++;
if ($counter % 3 == 0)
{
echo '<a href=#><img src="thumb.php?image=$currentImage alt="" /></a><br/>';
}
else
{
echo '<a href=#><img src="thumb.php?image=$currentImage" alt="" /></a>';
}
}
?>
So when I use this, it works ..
<img src="thumb.php?image=beach.jpg alt="" />
Thanks 😕