A light-weight DB class

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

Post Reply
aitch
Forum Newbie
Posts: 1
Joined: Fri Sep 19, 2008 4:29 pm

A light-weight DB class

Post 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.
Attachments
DB類別_20080920.rar
(8.86 KiB) Downloaded 187 times
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: A light-weight DB class

Post by pickle »

Moved to "Coding Critique" forum.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply