Great. Answers. Now we be jamming. I think I might have that book. With 2 recommendations so far, that will be my next book. 100K buffer? That's not just for the query? That includes whatever file I'm trying to copy in? Bummer, I guess that rules out ISOs. Php is just a wrapper like C. It's the SQL code that I need to learn. C is my favorite language so, once I get to that book, I might be able to take this information back to Windows with me. >>> [EMAIL PROTECTED] 2/22/2001 7:01:12 PM >>> On Thu, Feb 22, 2001 at 05:23:00PM -0800, Bob Crandell wrote: > Hi, > I'm using Apache/PHP/MySQL to learn SQL. Besides dazzling > people with my prowess, I'd like to be able to store digital > pictures in the database. So far, I've gotten to the chapter > that creates a form to type in a product code, description and > price. Yawn. > Does anyone know the SQL code to insert a binary file into a > MySQL database? What type of field does it take? I didn't see > mention of a blob. Maybe that's the next book. > > Thanks Try "MySQL" by Paul DuBois, New Riders Publishing. (there is no next after this, IMHO) CREATE TABLE my_images ( image_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, image_data BLOB ); sizes in bytes TINYBLOB 2^8 - 1 BLOB 2^16 - 1 MEDIUMBLOB 2^24 - 1 LONGBLOB 2^32 - 1 Keep in mind the default query buffer is 100k I've never done this, and the book doesn't have a PHP example of using BLOBs. There is a C function on page 269 though. There are also some warnings of fragmentation. <[EMAIL PROTECTED]>
