RE: [PHP-DB] linking images

From: Date: Mon, 30 Apr 2001 17:17:04 +0000
Subject: RE: [PHP-DB] linking images
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-8997@lists.php.net to get a copy of this message
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/ robert@getmart.com 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:sharmad@goatelecom.com] Sent: Monday, April 30, 2001 7:06 AM To: php-db@lists.php.net 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: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#8997) next »