Barry,

This can be done using normal insert/update statements. You only have to
'escape' the binary zero, the backslash and the quotes (' or ") out;
suppose jpg contains the binary data, the following code will do the trick:

 (pseudo code:)

 for (i=length(jpg); i--; i>0) {
  if (jpg[i] in [#0, '\', '''', '"'] ) { jpg=jpg[1..i-1] + '\' +
jpg[i..length(jpg)]
 };


---- Original Message -----
From: "Barry Radloff" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 31, 2001 7:55 AM
Subject: Binary data


>
>
> hi I am pretty new at this and would like to know how does one store a
> binary blob to the mysql DB ie I would like to store a jpeg to the db
>
> Thanks
>
> Barry Radloff
> R&D
> Media24
>
> ---------------------------------------------------------------------
> 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

Reply via email to