I saved an original image in my database using the following fields:
file_name VARCHAR(255)
mime_type VARCHAR(255)
file_size INT
file_data LONGBLOB
My PHP code for saving is:
$image = $_FILES['image'];
$info = getImageSize($image['tmp_name']);
$query = "CALL saveImageInDataBase('" .
mysql_real_escape_string(file_get_contents($image['tmp_name'])) . "', '" .
mysql_real_escape_string($image['name']) . "', '" .
mysql_real_escape_string($info['mime']) . "', " . $image['size'] . ")";
$result = mysql_query($query);
I want to create a thumbnails of original images out of above data in the server (I’m using PHP) in order to display on the site (to display a list of links of images).
Can someone tell me the simplest way to do this?
You are doing the whole thing wrong.
For the particular code you may search either google or this site. There are over 100500 codes written already I believe.