PHP Classes

PHP JSON File Database: Create and manipulate databases using JSON files

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 70%Total: 210 All time: 8,368 This week: 455Up
Version License PHP version Categories
file-database 1.0.3GNU General Publi...5.4PHP 5, Databases, Files and Folders
Description 

Author

This class can create and manipulate databases using JSON files.

It can create database table and store them in files in a give database directory with data serialized in the JSON format. The class can also perform other operations like:

- Drop databases or tables
- Insert, update and delete table records
- Retrieve table records that match certain criterion

Picture of Mihajlo Siljanoski
  Performance   Level  
Name: Mihajlo Siljanoski <contact>
Classes: 6 packages by
Country: Macedonia Macedonia
Age: 39
All time rank: 14011 in Macedonia Macedonia
Week rank: 295 Up1 in Macedonia Macedonia Equal
Innovation award
Innovation award
Nominee: 1x

Example

<?php

//Example of use

require_once 'lib/filedb.php';

$db=new filedb('testdatabase');


//if you like to drop database and all tables
//$db->drop_database();

//if you like to drop user table
$db->drop_table('user');


//if you like to create user table
$db->create_table('user');



//if you like to add record in user table if table user doesn't exist automaticaly will be created
$db->insert('user',['name'=>'Mihajlo','surname'=>'Siljanoski','web'=>'http://1mk.org/','username'=>'admin','password'=>md5('admin')]);



//to update record in user table
$db->update(
       
'user',
        [
'surname'=>'Siljanoski updated','web'=>false,'address'=>'Test address'],//address will be added and web will be deleted
       
['_id'=>1,'name%'=>'mihajlo'] // where ID =1 AND name LIKE '%mihajlo%'
);


//to delete record with _id=5
$db->delete(
       
'user',
        [
'_id'=>5]
);


//fetch records from database something like SELECT * FROM users WHERE name='Mihajlo' AND surname LIKE '%ski%'
$results=$db->get('user',
        [
           
'name'=>'Mihajlo',
           
'surname%'=>'ski',
        ]
    );
print_r($results);


Details

file-database

Non-sql database on filesystem

Non-sql database based on file system. With this class you can add storage on filesystem and access data on simplest way ever.


  Files folder image Files  
File Role Description
Files folder imagelib (1 file)
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file example2.php Example relations example
Accessible without login Plain text file example3.php Example Example file
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  lib  
File Role Description
  Plain text file filedb.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:210
This week:0
All time:8,368
This week:455Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:70%StarStarStarStar
Rank:244