Page 1 of 1

image to db problem

Posted: Thu Jun 03, 2004 9:58 am
by lostboy
Hi Guys,

Question: Is there a limit to the size of an image that can be loaded into mysql with PHP? I know, I know, but its not my decision to do this. The powers that be are rather close minded about this.

I have heard there is a 64k limit to a single variable and obviously a 64K variable can't hold a 1.5M image, can it?

The goal of this little task is copy certain rows of data from a remote host DB to a local system (and eventually to re-sync the host db).
Please let me know your thoughts...

TIA

Posted: Thu Jun 03, 2004 10:04 am
by choppsta
I presume you are referring to storing the images (binary data) in a MySQL database...

Don't quote me on this, but I think the size is only limited to the amount of disk space available...

Posted: Thu Jun 03, 2004 10:21 am
by pickle
'BLOB' type can only hold 64K, 'MEDIUMBLOB' type can only hold 1.6 MB, but 'LONGBLOB' can hold 4.2 GB - so that should be big enough to hold anything you want.MySQL table sizesare kind of limited too.

Posted: Thu Jun 03, 2004 10:39 am
by lostboy
So there are no PHP limits to the size of the data in the variable? We have data fields that hold more than 85K...is this a problem...this is what I need to sort out

Thanks

Posted: Thu Jun 03, 2004 11:12 am
by pickle
I don't think there's a MySQL limit to the size of the data in a particular field beyond those restricted by the column type. I've got fields with over 300K and there's no problem. Like I said, LONGBLOB can hold 4.2 GB, so you should be fine.

Posted: Thu Jun 03, 2004 11:12 am
by lostboy
thanks