Hi
I'm really new to php and am trying to make an online gallery at the moment and I'm struggling a hell of a lot.
I'm storing the images in a Blob at the moment as it was the only way I could make it work at the time and dont have time to fix this now and I cant seem to get them back out again. Does anyone have any ideas on this?
The idea is that two copies of the image will be stored at different sizes in different tables(one as a thumbnail and one normal size).
I know its a FAQ and I know that using Blobs is frowned upon but I dont have the time to change it now and I just cant find the help I seem to need.
My code for the two insert statements is:
$sql = "INSERT INTO tbl_images
( image_type ,image, image_size, image_name, log_name, gallery_id)
VALUES
('{$size['mime']}', '{$imgData}', '{$size[3]}', '{$FILES['pix']['name']}', '{$SESSION['logname']}', '{$_POST['gallery']}')";
$result = mysql_query($sql) or die(mysql_error());
$last_id = mysql_insert_id();
$query = "SELECT * FROM tbl_images WHERE image_id = $last_id";
$result = mysql_query($query) or die('Error with query.');
while ($row = mysql_fetch_array($result)){
extract ($row);
echo "$image_id";
}
$sql2 = "INSERT INTO tbl_thumb
(thumb_id, thumb_type ,thumb, thumb_size, log_name, gallery_id)
VALUES
( '{$image_id}' ,'{$size['mime']}', '{$imgData}', '{$size[3]}', '{$SESSION['logname']}', '{$POST['gallery']}')";
$result = mysql_query($sql2) or die(mysql_error());
At the moment the two images are the same size as I cant work out the resizing.
Any help would be fantastic.
Andy