Re: no clues on blobs
| From: | (Richard Lynch) | Date: | Thu, 06 Jul 2000 00:18:43 +0000 |
| Subject: | Re: no clues on blobs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5113@lists.php.net to get a copy of this message | ||
In article <00070417542400.29460@math.unl.edu.ar>, martin@math.unl.edu.ar
("Martin A. Marques") wrote:
> I'm clueless about working with blobs on Informix. I really don't get it. How
> do I insert a blob TEXT in a table column? I really looked at the manuals,
> but I guess I need an example, else I won't be able to get this working.
It's usually a special set of functions to create a BLOB and to read/write
it. The actual BLOB in the row is really just an ID to point to the
psuedo-data-file containing the BLOB...
I don't know Informix, but it should go more or less like this:
$blobid = if_create_blob() or die("Could not create blob");
if_write_blob($blobid, $hugetext);
$query = "insert into sometable(author, blobdata) values('$author', $blobid)";
$insert = if_exec($connection, $query) or die($query);
That's usually the general plan for BLOB insertion.
Later, you'll be getting your $blobid as a result of a SELECT query, and
you'll need to do something not unlike.:
$hugetext = if_read_blob($blobid);
Hope that helps. Hope it's right :-)
--
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!)