PHP code example of bainternet / sqlite-simple-store

1. Go to this page and download the library: Download bainternet/sqlite-simple-store library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bainternet / sqlite-simple-store example snippets


 
//once('SQLite_simple_store.php');

//instanceate the class
$s = new SQLite_simple_store('user_table');

//simple set key => value
$s->set('name','oha');

//simple get value by key
echo $s->get('name'); //oha

//set with expiretion time
$s->set('token','asdjjrt788dsfjjj447586',6000);

//update value
$s->set('name','ohad');

//get all keys
var_dump($s->keys());

//set a more complex value
$s->set('user_1',
    array(
        'user_id' =>  1,
        'email'   => '[email protected]',
        'meta'    =>  array(
            'user_meta1' => 'some value',
            'user_meta2' => 'some other value',
        )
    )
);