Jump to content


Photo

blob and tumbnails


  • Please log in to reply
3 replies to this topic

#1 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 29 August 2006 - 01:34 PM

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-tut...ysql-upload.php

#2 Iceman512

Iceman512
  • Members
  • PipPipPip
  • Advanced Member
  • 81 posts

Posted 29 August 2006 - 02:38 PM

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

#3 Iceman512

Iceman512
  • Members
  • PipPipPip
  • Advanced Member
  • 81 posts

Posted 29 August 2006 - 02:45 PM

Here's the snippet to link back to the original image;

<?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>";
             
?>


It may need some modifications,
Regards,
Iceman

#4 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 29 August 2006 - 09:56 PM

thanks for reply,i will take a look now




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users