Jump to content

Archived

This topic is now archived and is closed to further replies.

feri_soft

blob and tumbnails

Recommended Posts

How to create a tumbnail fron blob data and then add a link with the tumnail to te original images.


For adding data and viewing it i would use this tutorial:

http://php-mysql-tutorial.com/php-mysql-upload.php

Share this post


Link to post
Share on other sites
Hi Feri_soft,

It would be very confusing to put all the code in here, so take a look at:
http://www.sum-it.nl/en200319.php3

Hope it helps you!
Regards,
Iceman

Share this post


Link to post
Share on other sites
Here's the snippet to link back to the original image;

[code]
<?php
header("Content-type: image/jpeg"); // act as a jpg file to browser

$oDatabase = mysql_connect("localhost", "your_database_user_id", "your_database_password");
mysql_select_db("your_database_name", $oDatabase);

$sQuery = "SELECT thumbnail
FROM your_table
WHERE id = $id";
$oResult = mysql_query($sQuery, $oDatabase);

$oRow = mysql_fetch_array($oResult);
$sJpg = $oRow["thumbnail"];
            // To link back to the original image, do the following:
    echo "<a href='";
    echo $Jpg; // Or whatever the image is called in the db
    echo "'>";
    echo $sJpg;
    echo "</a>";
           
?>

[/code]

It may need some modifications,
Regards,
Iceman

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.