I tend to use LOAD_FILE(), but your file has to be on the server and readable by MySQL ("INSERT INTO table ( field1, field2 ) VALUES ( 'a', LOAD_FILE( 'filepath' )" ). If you're using a programming language rather than just the MySQL client, you can also read the file into a variable and insert the contents of the file like any other value.

If you Google for something like "storing images in MySQL", you will come up with a bunch of different tutorials that can guide you (storing images seems to be a popular demonstration of working with files).

Wes

On Aug 5, 2004, at 2:25 PM, Nathan Mealey wrote:

I am at a loss as to how to insert files into a BLOB column in a database, and how to extract them. Basically, I want to store files in the database itself, but do not know how to go about doing this.

What sort of queries do you run to do this? Is it the same as regular "insert" and "select" syntax?

Any help would be much appreciated.

Thanks,
Nathan
--
Nathan Mealey
Director of Operations
Cycle-Smart, Inc.
P.O. Box 1482
Northampton, MA
01061-1482
[EMAIL PROTECTED]
(413) 587-3133
(413) 210-7984 Mobile
(512) 681-7043 Fax


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to