Re: [sqlite] PHP Code That Can Store and Retrieve Images
Kees, Thanks for the interest in this and replied off-list. Bart -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kees Nuyt Sent: 12 March 2008 22:06 To: General Discussion of SQLite Database Subject: Re: [sqlite] PHP Code That Can Store and Retrieve Images On Wed, 12 Mar 2008 18:44:36 -, Bart wrote: >Kees, > >Would you be interested to do a project for me for a fee? [..] >Regards, Bart Smissaert Answered in private mail. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
On Wed, 12 Mar 2008 18:44:36 -, Bart wrote: >Kees, > >Would you be interested to do a project for me for a fee? [..] >Regards, Bart Smissaert Answered in private mail. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
Robert L Cochran <[EMAIL PROTECTED]> writes: > > Is there open source PHP code (PHP 5.x compatible) that can store and > retrieve images from an SQLite 3.5.6 database? > Here's a quick example I came up with... it's using sqlite2 (I guess I have an old version of php or something like that :P), but it should work with an sqlite 3 database / driver once you change the string that opens the database... import.php getMessage()); } // create page view database table $db->exec('DROP TABLE images;'); $db->exec('CREATE TABLE images(id, image)'); // insert page visit in database with a prepared statement $insert_sql = 'INSERT INTO images (image) VALUES (:image)'; $images = array('1.jpg', '2.jpg'); try { $i = 1; foreach( $images as $image ) { echo 'INSERT INTO images (id,image) VALUES (' . $i . ', "' . encodeImage($image) . '");'; echo '[' . $db->exec('INSERT INTO images (id,image) VALUES (' . $i++ . ', "' . encodeImage($image) . '");') . ']'; } } catch( PDOException $exception ){ die('Error: ' . $exception->getMessage()); } ?> List.php getMessage()); } foreach ($db->query('SELECT * FROM images;') as $image) { echo 'View Image ' . $image['id'] . ''; echo $image['image'] . ''; } ?> view.php getMessage()); } define( 'ID', intval( $_REQUEST['id'] ) ); $image = $db->query('SELECT * FROM images;')->fetch(); header( 'Content-type: image/jpg' ); echo decodeImage($image['image']); ?> ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
Good point Kees. I forgot about the serialize(). I don't used it because I use my sqlite db with PHP, .NET and VB6. But if the project is going to PHP only serialize() is the way to go. On Wed, Mar 12, 2008 at 2:38 PM, Kees Nuyt <[EMAIL PROTECTED]> wrote: > On Wed, 12 Mar 2008 09:10:44 -0400, you wrote: > > >Here is a link to the PHP code to generate the base64 string and to > convert > >the string back to an image. > > > >http://fundisom.com/phparadise/php/image_handling/base64_image_encode > > > > In PHP it might be better to serialize(). > That works for every value type. > Just my 0.02 > -- > ( Kees Nuyt > ) > c[_] > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
Kees, Would you be interested to do a project for me for a fee? I need to upload/download data to/from a hosted SQLite 3 DB. This has to be done from VBA or from a VB6 AX dll. I have posted this to RAC, but there seems little interest/progress. If interested then could you contact me off-list? I could correspond in Dutch. Regards, Bart Smissaert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kees Nuyt Sent: 12 March 2008 18:39 To: General Discussion of SQLite Database Subject: Re: [sqlite] PHP Code That Can Store and Retrieve Images On Wed, 12 Mar 2008 09:10:44 -0400, you wrote: >Here is a link to the PHP code to generate the base64 string and to convert >the string back to an image. > >http://fundisom.com/phparadise/php/image_handling/base64_image_encode > In PHP it might be better to serialize(). That works for every value type. Just my 0.02 -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
On Wed, 12 Mar 2008 09:10:44 -0400, you wrote: >Here is a link to the PHP code to generate the base64 string and to convert >the string back to an image. > >http://fundisom.com/phparadise/php/image_handling/base64_image_encode > In PHP it might be better to serialize(). That works for every value type. Just my 0.02 -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
Here is a link to the PHP code to generate the base64 string and to convert the string back to an image. http://fundisom.com/phparadise/php/image_handling/base64_image_encode On Wed, Mar 12, 2008 at 8:56 AM, <[EMAIL PROTECTED]> wrote: > I am not actually dealing with images, but normal > text and integer data. > Got one reply now from RAC, so will see what comes from it. > > RBS > > > > > The easiest way to store an image would be to first convert the image to > > base64 and store the base64 text to the database. Converting data to > > base64 > > takes up about 33% more space than the original data. > > > > On Tue, Mar 11, 2008 at 6:22 PM, RB Smissaert < > > [EMAIL PROTECTED]> wrote: > > > >> Funny you ask that as just 2 days ago I posted a little project > >> on RAC to do exactly this. In my case it has to be called from > >> VBA or VB. Unfortunately and surprisingly no takers yet. > >> > >> RBS > >> > >> > >> -Original Message- > >> From: [EMAIL PROTECTED] > >> [mailto:[EMAIL PROTECTED] On Behalf Of Robert L Cochran > >> Sent: 11 March 2008 21:15 > >> To: General Discussion of SQLite Database > >> Subject: [sqlite] PHP Code That Can Store and Retrieve Images > >> > >> Is there open source PHP code (PHP 5.x compatible) that can store and > >> retrieve images from an SQLite 3.5.6 database? > >> > >> For SQLite version 3.5.x, I need to use the PHP PDO functions if I am > >> using PHP 5.2.5, right? > >> > >> I want to show a group of people about 45 photos which I would like to > >> store on an SQLite database and then retrieve. > >> > >> Thanks > >> > >> Bob Cochran > >> ___ > >> sqlite-users mailing list > >> sqlite-users@sqlite.org > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > >> > >> > >> ___ > >> sqlite-users mailing list > >> sqlite-users@sqlite.org > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > >> > > ___ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
The easiest way to store an image would be to first convert the image to base64 and store the base64 text to the database. Converting data to base64 takes up about 33% more space than the original data. On Tue, Mar 11, 2008 at 6:22 PM, RB Smissaert < [EMAIL PROTECTED]> wrote: > Funny you ask that as just 2 days ago I posted a little project > on RAC to do exactly this. In my case it has to be called from > VBA or VB. Unfortunately and surprisingly no takers yet. > > RBS > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Robert L Cochran > Sent: 11 March 2008 21:15 > To: General Discussion of SQLite Database > Subject: [sqlite] PHP Code That Can Store and Retrieve Images > > Is there open source PHP code (PHP 5.x compatible) that can store and > retrieve images from an SQLite 3.5.6 database? > > For SQLite version 3.5.x, I need to use the PHP PDO functions if I am > using PHP 5.2.5, right? > > I want to show a group of people about 45 photos which I would like to > store on an SQLite database and then retrieve. > > Thanks > > Bob Cochran > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP Code That Can Store and Retrieve Images
Funny you ask that as just 2 days ago I posted a little project on RAC to do exactly this. In my case it has to be called from VBA or VB. Unfortunately and surprisingly no takers yet. RBS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert L Cochran Sent: 11 March 2008 21:15 To: General Discussion of SQLite Database Subject: [sqlite] PHP Code That Can Store and Retrieve Images Is there open source PHP code (PHP 5.x compatible) that can store and retrieve images from an SQLite 3.5.6 database? For SQLite version 3.5.x, I need to use the PHP PDO functions if I am using PHP 5.2.5, right? I want to show a group of people about 45 photos which I would like to store on an SQLite database and then retrieve. Thanks Bob Cochran ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] PHP Code That Can Store and Retrieve Images
Is there open source PHP code (PHP 5.x compatible) that can store and retrieve images from an SQLite 3.5.6 database? For SQLite version 3.5.x, I need to use the PHP PDO functions if I am using PHP 5.2.5, right? I want to show a group of people about 45 photos which I would like to store on an SQLite database and then retrieve. Thanks Bob Cochran ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users