Skip to content
A tiny library for managing create / read / update / delete operations
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


I kept re-implementing (badly) a bunch of code to do this stuff. Instead of implementing it badly a 10th time, I decided to put it into a self-contained library with the union of features.

Currently this uses FFS-PHP's PDO, but it wouldn't be too hard to use vanilla PDO if anybody requested that feature.

use \MicroCRUD\{Table, ActionColumn, TextColumn};

class MyTable extends Table {
    public function __construct($db) {
            TextColumn("username", "Username"),
            TextColumn("email", "Email Address"),

$t = MyTable($db);
		[... titles and search fields ...]
		[... contents of the table, in pages ...]
		[... code to add a new entry ...]

Notes for anything that might be non-obvious

The InetColumn type supports exact matching for most databases, but with Postgres, it supports range matching (eg searching for "" will return search results including ""). It'd be nice to support this cross-database, but pragmatically, one person has asked for this feature, they are using postgres as a backend, and postgres makes this trivial :P

You can’t perform that action at this time.