On Do, 1999-08-12 00:04:32 -0700, Jose Albert wrote:
> This is my first mail in this group.
> Can some body let me know if MySql supports graphics fields?
There's no special column type for images, but for any kind of binary
data just use some of the BLOB types (Binary Large OBjects), only
depending of the desired maximum size:
TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB
MySQL manual "7.2.1 Column type storage requirements", e.g.
MySQL manual "184.108.40.206 The BLOB and TEXT types", e.g.
<URL: http://www.mysql.com/Manual_chapter/manual_Reference.html#BLOB >
There are no special functions to get only a part out of a BLOB (or a
part of an image), one always has to retrieve the BLOB as a whole.
A short summary by Christan Mack:
| > im going to try storing binary jpg/gif (200x150) pics into a mysql
| > db for the first time.
| You should use one of the BLOB types.
| Before inserting, you have to escape the characters ' " \
| But when getting it out, you will get the correct binary without
| If your pictures are larger than 100 KBytes, then you should store
| them in the filesystem, not in mysql.
| In one mysql 3.22.xx table you can only store up to 4 GBytes.
| This can be limited by your OS to 2 GBytes.
| So you only can store less than 20000 pictures a 100 KBytes in one
| > how can i call it to view on a web page [...]?
| To view the picture in a HTML page, you have to include a normal
| <img>-tag, but the URL for the image is another CGI program which
| pulls the binary data out of mysql. In this CGI you have to set the
| Content-Type to image/gif or image/jpg.
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26 E4 EC 80 58 7B 31 3A D7
|• Bynary field?||Jose Albert||12 Aug|
| • Re: Bynary field?||Martin Ramsch||12 Aug|