Page 1 of 1

A light-weight DB class

Posted: Fri Sep 19, 2008 4:32 pm
by aitch
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.


I just wrote a simple and light-weight database class for easy manipulation upon MySQL.

Code: Select all

$matchArray = array(
array(
'field'=>'id',
'value'=>1,
'operator'=>'>=',
'concator'=>'AND'
),
array(
'field'=>'value',
'value'=>'%',
'operator'=>' LIKE '
)
);
$result = $db->match('test_driver',$matchArray);
if($db->isError()){
echo $db->getError();
}
I trying to abstract SQL from day-to-day PHP works. All the use cases are in the Database.test.driver.php.

Enjoy it.


~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.

Re: A light-weight DB class

Posted: Mon Sep 22, 2008 11:02 am
by pickle
Moved to "Coding Critique" forum.