News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Building a simple SQL wrapper with PHP
May 14, 2012 @ 10:17:10

In this new post to his blog Gonzalo Ayuso has shared a simple SQL wrapper that he uses to work with his databases. It takes in an injection of the database connection component (a href="http://php.net/pdo">PDO) and provides functionality for inserts, updates, etc. with transaction support.

If we don't use an ORM within our projects we need to write SQL statements by hand. I don't mind to write SQL. It's simple and descriptive but sometimes we like to use helpers to avoid write the same code again and again. Today we are going to create a simple library to help use to write simple SQL queries.

It's a lightweight library that'd be good for basic uses, but when you start getting into something a bit more complex, something like Doctrine2 or Propel might be a better solution (or whatever your framework of choice has built in).

0 comments voice your opinion now!
sql wrapper tutorial pdo injection


blog comments powered by Disqus

Similar Posts

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite

Architexa Blog: Simplifying Dependency Injection

Chris Renner's Blog: Gerrymandered Code: Extending Zend_Registry to globalize session vars

DevShed: Searching and Replacing Nodes with SimpleXML in PHP 5 (Part 3)

Codeception.com: Working with PHPUnit and Selenium Webdriver


Community Events











Don't see your event here?
Let us know!


release code hack component application example language opinion unittest symfony2 overview install introduction hhvm facebook package podcast composer framework security

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework