Re: HELP, blobs in informix
| From: | (Richard Lynch) | Date: | Tue, 04 Jul 2000 02:53:03 +0000 |
| Subject: | Re: HELP, blobs in informix | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4661@lists.php.net to get a copy of this message | ||
In article <00070312234102.19603@math.unl.edu.ar>, martin@math.unl.edu.ar
("Martin A. Marques") wrote:
> I have hard troble trying to understand how PHP works with blobs. especially
> with the funtion ifx_create_blob, in which I can't understand the third
> parameter. The manual says this:
>
> ifx_create_blob
>
> ifx_create_blob -- Creates an blob object
>
> Description
>
> int ifx_create_blob(int type, int mode, string param);
>
> Creates an blob object.
>
> type: 1 = TEXT, 0 = BYTE
>
> mode: 0 = blob-object holds the content in memory, 1 = blob-object holds
the content in file.
>
> param: if mode = 0: pointer to the content, if mode = 1: pointer to the
filestring.
>
> Return FALSE on error, otherwise the new blob object-id.
>
>
> I don't understand the param (third) parameter. How is it? What should I put
> there?
I'm guessing that you either put a variable with a really long string in
there (mode 0) or the path to a file (mode 1)
At least, that's how I read it...
Sample:
$image = CreateGif();
.
.
.
$blob1 = ifx_create_blob(0, 0, $image);
$blob2 = ifx_create_blob(0, 1, "/path/to/other/image.gif");
$blob3 = ifx_create_blob(1, 0, "This is a chunk of text in RAM");
$blob4 = ifx_create_blob(1, 1, "/path/to/text.txt");
Disclaimer: I could be reading this entirely wrong...
If it works, add my sample code to the user notes, okay?
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)