Interesting PHP MySQL Library

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
Atlas
Forum Newbie
Posts: 2
Joined: Fri Mar 18, 2011 5:49 pm

Interesting PHP MySQL Library

Post by Atlas »

So I recently ran across a library that's apparently not well known.. It's called MeekroDB. Basically it takes care of things like escaping parameters so I can do things like:

Code: Select all

$results = DB::query("SELECT * FROM some_table WHERE id > %i AND name != %s", 15, 'Sand');
foreach ($results as $result) {
  echo $result['name'];
}
Or if I only need one field, I can do something like:

Code: Select all

$counter = DB::queryFirstField("SELECT COUNT(*) FROM some_table");
echo "We have $counter rows";
To me, that's soooooo much easier than what mysqli forces me to go through, and I don't need to escape stuff all the time. After switching to it, my script is a third shorter and much more readable.
Post Reply