|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Images
Date: Jan 26 1999 2:26PM
>>>>> "Mike" == Mike Prinsen writes:
Mike> Is there a method of getting
Mike> images from the database or is it best to just store the path
Mike> and then retrieve them from disk? Any comments would be
Mike> helpful.
You can use a straight select to retrieve images from the database. Or
you can use dbreadtext() (DBlib) or ct_get_data() (CTlib) to read
specific TEXT or IMAGE columns.
Note that when using straight SELECTs with CTlib IMAGE datatypes are
returned as Hex strings rather than binary data (TEXT datatypes are
returned as-is). You can convert back to raw data using:
$binary = pack("H*", $hex_string);
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|