Hi
Im new to php and have spent the last 2 days trying to work something out and I'm at the point of panic now as the thing I cant work out is for a school project.
The aim of this is to add an image as a blob to a database table and to add a thumbnail sized image to another table at the same time. Both these images need to have the same ID number to make things easier down the road. At the moment I'm trying to make the two have the same ID by:
$sql = "INSERT INTO tbl_images
( image_id , image_type ,image, image_size, image_name, log_name, gallery_id)
VALUES
('', '{$size['mime']}', '{$imgData}', '{$size[3]}', '{$FILES['pix']['name']}', '{$SESSION['logname']}', '{$_POST['gallery']}')";
$var = mysql_insert_id();
echo $var;
The problem is that it is returning mysql_insert_id with a value of zero instead of the same number as the image_id (which is an auto increment field).
Any help would be really good as I cant move on till Ive done this bit.
Thanks in advance to anyone who can help me out here.
Andy