-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
damon-kronski edited this page Oct 28, 2014
·
2 revisions
This command creates an instance for use with client-side cookies.
$cookieName = "JsonDB";
$defaultArray = array(array('id' => 1,'name' => 'Test Item 1','value' => 'Lorem Ipsum'));
$JsonDB = JsonDB::withCookie($defaultArray,$cookieName);
This command creates an instance for use with a global .json file.
$jsonPath = "data/db.json";
$defaultArray = array(array('id' => 1,'name' => 'Test Item 1','value' => 'Lorem Ipsum'));
$JsonDB = JsonDB::withJson($defaultArray,$jsonPath);
This command returns an array of the database.
$JsonDB->readDB();
This command inserts data into the database.
$JsonDB->addItem(array('name' => 'Added Item','value' => 'Now it is in the database.'));
This command updates data of the database.
$JsonDB->setItem(1,array('name' => 'Added Item','value' => 'Now it is in the database.'));
This command deletes data from the database.
$JsonDB->delItem(1);