CRUDités: PHP5 class for MySQL database

Homepage > Diary > Coding > CRUDités: PHP5 class for MySQL database

Tue 07/07/2009

in Coding, PHP, Projects

Even if nowadays many web developers prefer to use Frameworks such as Zend, CakePHP or CodeIgniter, we often have small coding tasks to do, that aren’t worth the cost of deploying a whole application structure.

ezSQL

When dealing with MySQL databases, one of the most used PHP class is ezSQL, by Justin Vincent. If you’ve never listen about it, just think that a slightly modified version of this class is used as the core of Wordpress database library, and every time you query the database for a post, ezSQL comes in action.

Despite its effectiveness, ezSQL development seems to have stopped to version 2.04.

Since in my projects i often use this class to work with MySQL databases, i’ve written a small extension to the ezSQL_MySQL adapter to add shortcuts and more efficient functionalities to make further easier to manage databases’ data with PHP. Here you are CRUDités.

CRUDités: MySQL appetizer

CRUDités Logo

Crudités are traditional French appetizers comprising sliced or whole raw vegetables. As of its name, CRUDités is just a set of handy methods to quickly manage many operations of writing, storing and deleting from and to MySQL databases.

Aside from the basic ezSQL methods, it adds some methods to build MySQL queries from strings and data arrays, new methods to retrieve datas from columns and rows, some utility methods and a whole new table binding system, to store table’s fields and quickly update and store new datas.
For example you’ll be able to query a database and get a resulting array of rows just with this code:

$rows = $db->get_data(array(
      'select' => 'id,name,surname',
      'from' => 'customer_names'
));

You can get more informations about the project by visiting its main page, or you can directly download the class file by clicking here: CRUDités (13.5 KB)

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • BlinkList
  • blogmarks
  • DZone
  • LinkedIn
  • MySpace
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Ping.fm
  • Yahoo! Buzz
No Related Posts

Tags: , , ,

One Response to this post:

  • database says:

    database…

    Today Monday I found your article Oracle 10g+ Security and Audit – Part 1 | Database Geek Blog. Just curious: on what bases do you conclude your findings?…

Leave a Reply ()

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

* required.