This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Home
ezDB
By Nabeel Shahzad, based on ezSQL, by Justin Vincent (http://www.woyano.com/)
Why ezDB
For when you don’t need full-fledged ORM, but you still need a light-weight, flexible abstraction layer with updated support for PHP 5 specific features, and additional functionality.
Updates and Changes
I haven’t “released” a stable version just yet, until I finish a couple of things. The class, as it is now, does work properly, I try to keep it in a working state between commits.
Version 3.0, New Features
- PHP 5 Compatible
- Static class interface (no more globals, woo)
- MySQLi support (binding statements to come)
- Inline PHPDoc comments for Intelli-sense enabled editors
- Additional functionality, of quick_select(), quick_update(), quick_insert()
- Improved error logging and handling using try/catch
Upcoming Features
- memcache caching support
- Improvements to memory usage
- PHP 5.3 compatibility (namespaces support)
Examples
Real simple example:
$db = new ezDB_mysql();
$db->connect('mysql_user', 'password', 'localhost');
$db->select('db_name');
$results = $db->get_results('SELECT * FROM users');
foreach($results as $row)
{
echo "User {$row->id}: {$row->username}, {$row->email}<br />";
}
Error-handling, galore
$db = new ezDB_mysql();
try {
$db->connect('mysql_user', 'password', 'localhost');
$db->select('db_name');
} catch (ezDB_Error $e)
{
echo "Error occured: {$e->error} (code: {$e->errno})";
die();
}
try {
$results = $db->get_results('SELECT * FROM users');
} catch (ezDB_Error $e)
{
echo "Error occured: {$e->error} (code: {$e->errno})";
die();
}
foreach($results as $row)
{
echo "User {$row->id}: {$row->username}, {$row->email}<br />";
}






