View Single Post
Old 05-18-2009, 08:48 AM   #17 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
Does it need configuration?
Not really, just needs to be enabled (which mostly it is)

Quote:
Does it come with every shared hosts?
No idea, I wasn't under the impression this was to be a distributed script. However seen as the PHP manual says its enabled by default, I'm assuming it more than likely will be, I could be wrong ofc.

Sample sqlite script:
PHP Code:
try
{
    
$db = new SQLiteDatabase('sqlite.db');
    
$r $db->arrayQuery('SELECT * from tbl WHERE col = 2');
    
var_dump($r);
}
catch (
SQLiteException $e)
{
    die(
$e->getMessage());

It can even do transactions:
PHP Code:
try
{
    
$db = new SQLiteDatabase('sqlite.db');
    
$db->query('BEGIN;
        CREATE TABLE test ( id UNSIGNED MEDIUMINT(8) PRIMARY KEY, data TEXT NOT NULL);
        INSERT INTO test (data) VALUES(\'Data\');
        INSERT INTO test (data) VALUES(\'Data2\');
        COMMIT;'
);

    echo 
$db->changes() . ' Rows inserted.'//will echo '2 Rows inserted.
}
catch (
SQLiteException $e)
{
    die(
$e->getMessage());

__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote