2017 © Pedro Peláez
 

library ubdb

Lightweight PHP-JSON Database

image

uuur86/ubdb

Lightweight PHP-JSON Database

  • Wednesday, January 10, 2018
  • by uuur86
  • Repository
  • 2 Watchers
  • 2 Stars
  • 30 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

UBDB

JSON based database for PHP v0.328, (*1)

REQUIREMENTS

PHP >= 5.2.0, (*2)

INSTALL

Only include ubdb.php to your codes., (*3)

USAGE

$ubdb = new ubdb();
// For Selecting a language
$ubdb->lang('en');
// For Define db, table and columns
$ubdb->db('mydb', array(
                        'users'=>array(
                            'username',
                            'password',
                            'email',
                            'phone'
                        ),

                        'products'=>array(
                            'productname',
                            'productcode',
                            'title',
                            'description'
                        ),
                        'cart'=>array(
                            'productid',
                            'userid'
                        )   
                    )
                );

## ADD ROW ##, (*4)


// add a row $ubdb->add('cart', array('userid'=>'ugur'.$i)); // or // You can add multiple rows for($i=0;$i<10;$i++){ $ubdb->add('cart', array('userid'=>'ugur'.$i)); } // If you defined all rows, you can save for writing new datas. $ubdb->save();

## GET ROW ##, (*5)

 // For any simple query for getting datas
 // When runnig below code, will be same all getting datas
 // ? Symbol holding only one character, % symbol holding multiple character as place.
 $get1 = $ubdb->get("users", "username", array("ugur",'?','1') ); // matches such as ugur11
 $get2 = $ubdb->get("users", "username", array("ug",'%','1') );   // matches such as ugur11 or ugor21

 // Joining two data array on one intersect point
 $results = $ubdb->join(
            $get1,       // first array
                        $get2,       // second array
                        "username",  // first intersect point
                        "userid"     // secondary intersect point
                        );
 // Will return as an array which is username equals to userid
 ```
## DELETING ##
```php
$ubdb->delete($table,$id);

The Versions

10/01 2018

dev-master

9999999-dev

Lightweight PHP-JSON Database

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by Uğur Biçer

03/01 2018

v0.329

0.329.0.0

Lightweight PHP-JSON Database

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by Uğur Biçer

21/10 2017

v0.328

0.328.0.0

Lightweight PHP-JSON Database

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

20/10 2017

dev-0.328-stable

dev-0.328-stable

Lightweight PHP-JSON Database

  Sources   Download

MIT

The Requires

  • php >=4.6.0