iassasin/fidb

Very lightweight and simple database interface for PHP

Installs: 54

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/iassasin/fidb

v0.3.0 2025-02-06 15:37 UTC

This package is auto-updated.

Last update: 2025-10-06 17:22:01 UTC


README

Very simple and lightweight database connection wrapper making easer and safer to construct queries.

Install

Use composer to install fidb:

composer require iassasin/fidb

Usage

require_once 'vendor/autoload.php';

use Iassasin\Fidb\Connection\ConnectionMysql;

$db = new ConnectionMysql($host, $database, $user, $password);

$db->query('INSERT INTO table(num, str, txt) VALUES(%d, %s, %s)',
	123, 'string', 'and "text"'); // automatic string escaping

// build queries of any complexity with variables
$bs = $db->select()
	->column('str')
	->table('table')
	->where('num > %d', 30);

foreach ($bs->execute()->fetchAll() as $row){
	echo $row['str'];
}

More examples see in example