Right nailed it. If anyone wants to know how to make thumbnails, this is it. Create a new page called getthumb.php3 and insert this code changing where needed:
<?php
database connections and all that goes here
if (isset($GET['image_id'])) {
$image_id = $GET['image_id'];
$query = "SELECT FROM tbl_images WHERE image_id = '$image_id'";
$result = mysql_query($query);
if(mysql_num_rows($result) == 1) {
$fileType = mysql_result($result, 0, "image_type");
$fileContent = mysql_result($result, 0, "image");
$im = imagecreatefromstring($fileContent);
$width = imagesx($im);
$height = imagesy($im);
$imgw = 120;
$imgh = $height / $width $imgw;
$thumb=imagecreate($imgw,$imgh);
imagecopyresized($thumb,$im,0,0,0,0,$imgw,$imgh,imagesx($im),imagesy($im));
$out = imagejpeg($thumb);
header("Content-type: $fileType");
echo $out;
}
};
?>
image_id is the images primary key number.
image is the blob itself
image_type is the mime type.
The code to view the images is: <img src="getdata.php3?image_id=336"> where the image_id is equal to an actual image_id.
This isnt the ultimate answer but its taken me 4 days and this is the best I can come up with and if it can save anyone the frustration I've been through then its worth it.