No se como guardar una imagen en una bd (ni tampo se si se puede) pero lo que si puedes hacer, y creo es la mejor opción, es guardar los thum en una carpeta, y luego guardar el nombre del mismo en la bd.
En cuanto al script para crear los thumbnails aqui te dejo uno
Código PHP:
function crea_thumb($imagen, $tamano, $destino) {
$info = getImageSize($imagen, $info);
$old_x = $info[0];
$old_y = $info[1];
$new_w = (int)($tamano);
if (($new_w <= 0) || ($new_w > $old_x))
$new_w = $old_x;
$new_h = ($old_x * ($new_w / $old_x));
if ($old_x > $old_y) {
$thumb_w = $new_w;
$thumb_h = $old_y * ($new_h / $old_x);
}
if ($old_x < $old_y) {
$thumb_w = $old_x * ($new_w / $old_y);
$thumb_h = $new_h;
}
if ($old_x == $old_y) {
$thumb_w = $new_w;
$thumb_h = $new_h;
}
$im = imageCreateFromJPEG($imagen);
$orange = imageColorAllocate($im, 220, 210, 60);
$thumb = ImageCreateTrueColor($thumb_w, $thumb_h);
imageCopyResized($thumb, $im, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
imageJPEG($thumb, $destino, 70);
imageDestroy($thumb);
}