Christian, It's pretty easy, you can do it with a normal INSERT statement, all you've got to remember is that NUL (ascii 0) needs to be escaped as "\0", and that double quotes and single quotes should also be escaped (i.e. \" and \').
Getting the data back again is even easier, because it'll unescape all the data for you. You just need to get the length of the field using mysql_fetch_field_direct() (since you can't assume it's just a NUL terminated string due to the fact that it may have NULs embedded in it). This is what I use to store Unicode characters in the database. You just can't sort on them, that's all :) Dean Harding. -----Original Message----- From: Christian Nebenfuehr [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 29 May 2002 9:32 pm To: [EMAIL PROTECTED] Subject: Loading BLOB into a MySQL-DB Hello Outthere! Maybe this is a very simple question, but I'm a Rookie so lets see. I've tried to load BLOBs into my MySQL-DB, but I could not find a documentation how to do this. How can I load a BLOB, for example a PDF-File from my local filesystem into the database (which SQL-commands do I have to use or how can I do it via a JDBC-Connection)? Thanks, for help. Christian --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php