Binary Large Objects permit storage of any operating system file, including
images or large files directly into the database, Use lo_import() to load an
object into the database and lo_export() to retrieve.

CREATE TABLE picture(name char(20), photo OID);  -- as an example.

The lo_import() stores a path, i.e., /../...jpg and so on, into the
database. The function call returns an OID that is used to refer to the
imported large object. It is stored in picture.photo thus:

INSERT INTO picture VALUES ('blabla', lo_import('/directory path/..jpg'));

To retrieve it do:

SELECT lo_export(picture.photo, '/export path, i.e., /tmp/outimage.jpg')
FROM picture WHERE name = 'blabla';



Robert B. Barrington

GetMart Commercial Ecom: Web Administrator
http://weddinginlasvegas.com/
http://getmart.com/
[EMAIL PROTECTED]
Vegas Vista Productions
3172 North Rainbow Boulevard
Suite 326
Las Vegas, Nevada 89108-4534
Telephone: (702)656-1027
Facsimile: (702)656-1608

-----Original Message-----
From: Sharmad Naik [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 7:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] linking images

I m using postgresql-7.0.2 with php,My problem is that this database
doesn't allow more than 4k images to be stored .
I wanted to know how to store images in a
directory and keep its link in the dbase or if anyone can tell me how to
split
the image so that it can be kept in the dbase
-Thanks
--
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
__    _  _      _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to