PHPackages                             mitchellurgero/jsondatabase - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mitchellurgero/jsondatabase

ActiveLibrary

mitchellurgero/jsondatabase
===========================

Flat-file Database that uses JSON to store data in a file structure similar to MySQL.

412PHP

Since Apr 25Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mitchellurgero/jsondatabase)[ Packagist](https://packagist.org/packages/mitchellurgero/jsondatabase)[ RSS](/packages/mitchellurgero-jsondatabase/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

JSONDatabase class written by Mitchell Urgero
===============================================================

[](#jsondatabase-class-written-by-mitchell-urgero-infourgeroorg)

- GitHub:

### This DB class supports the following functions:

[](#this-db-class-supports-the-following-functions)

- init("DATABASE\_NAME", "DATABASE\_LOCATION" = null); //Load or create new database, then select it. (Optionally give a location to store the databse)
- insert("TABLE\_NAME", '{"data":"in","JSON":"format"}', int = null);//Insert or add a new row into given table (Optional 3rd option: replace given row number)
- select("TABLE\_NAME", "WHERE" = null, "EQUALS" = null);//get data from selected row
- create\_table("TABLE\_NAME");//Create a new table with the given name.
- delete\_table("TABLE\_NAME");//Delete the given table.
- dump\_tables();//Dump all tables AND their data (Mostly for backup purposes.)
- check\_table("TABLE\_NAME");//Check if a table exists. Returns number of rows if table exists.
- list\_tables();//List all available tables in selected database.
- import("JSON\_STRING\_OF\_DB\_BACKUP");//import a database backup and restore into the given database.

Things to note:
===============

[](#things-to-note)

- row\_id is the row number. This is not written to the db BUT generated on the fly. and always exists as a part of the row data
- dump\_tables() will always take a little bit of time because it dumps ALL THE TABLES TO AN ARRAY.

How To Use
==========

[](#how-to-use)

include('db.php');

$db = new JSONDatabase("DATABASE\_NAME");

$db-&gt;functionName(options);

Install
=======

[](#install)

Either git clone this repository, or use `composer require mitchellurgero/jsondatabase` to install via composer.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3393cfb3bc12748a8f5ba59c89bbf0e4fb69808b9c60a0a20a8cb54d3fac5bd1?d=identicon)[mitchellurgero](/maintainers/mitchellurgero)

---

Top Contributors

[![mitchellurgero](https://avatars.githubusercontent.com/u/4168998?v=4)](https://github.com/mitchellurgero "mitchellurgero (27 commits)")[![simon511000](https://avatars.githubusercontent.com/u/31013205?v=4)](https://github.com/simon511000 "simon511000 (10 commits)")

### Embed Badge

![Health badge](/badges/mitchellurgero-jsondatabase/health.svg)

```
[![Health](https://phpackages.com/badges/mitchellurgero-jsondatabase/health.svg)](https://phpackages.com/packages/mitchellurgero-jsondatabase)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
