PHP Classes

File: example3.php

Recommend this page to a friend!
  Classes of Mihajlo Siljanoski   PHP JSON File Database   example3.php   Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: Example file
Class: PHP JSON File Database
Create and manipulate databases using JSON files
Author: By
Last change: Update of example3.php
Date: 1 year ago
Size: 596 bytes
 

Contents

Class file image Download
<?php

//example of using as free storage

require_once 'lib/filedb.php';

$storage = new filedb('exampledb');


$storage->save('users','mihajlo.siljanoski',[
   
'gender'=>'male',
   
'username'=>'mihajlo.siljanoski',
   
'city'=>'Skopje',
   
'country'=>'Macedonia'
]);

$storage->save('users','john.smith',[
   
'gender'=>'male',
   
'username'=>'john.smith',
   
'city'=>'New York',
   
'country'=>'USA'
]);

$storage->remove('users','mkdelta');

$users=$storage->read('users');

foreach(
$users as $user){
   
   
$userData=$storage->read('users',$user);
   
   
print_r($userData);
   
}