On Fri, 13 Nov 2009, Artur Reilin wrote:

> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> From: Artur Reilin <sql...@yuedream.de>
> Subject: Re: [sqlite] image upload to db trouble
>
>>      //echo $images;
>>       $db = new PDO('sqlite: database.sqlite3');
>>
>>       $con = sqlite_open('sqlite: database.sqlite3');
>> if (!$con)
>>   {
>>   die('Could not connect: ' . mysql_error());
>>   }
>
> why you first make a new db opject and then open an connection to the
> database? new PDO sqlite already open an connection .. as i am right.
>
> and why mysql_error() ?
>
>>
>>        $db->query('sqlite: database.sqlite3', $con);
>>
>>        $db->query ("INSERT INTO images (id, images, info, url)
>>        VALUES ('$i', '$images', '$info', '$url')");
>>
>>        $db->query("DELETE FROM images WHERE id='$i'");
>> }
>
> AS i know, if you want to put images in your db you need blob columns and
> these are supported in sqlite3. or i understand something wrong?

There's no need to save the actual image in the sqlite 
database, as that could slow things like SELECT statements 
down.

Another way is to move the image file to a certain 
directory. Then store only the location of the image file in 
the sqlite DB.

If you move the sqlite DB, then just make sure the directory 
of images also goes with it.

Kind Regards,

Keith Roberts.

-----------------------------------------------------------------
Websites:
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to