News 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. Part 2.
June 18, 2012 @ 10:05:50

Gonzalo Ayuso has followed up his previous post about creating a simple SQL wrapper with PDO in PHP with this new post, a "part two" looking at improving it a bit with a new class to represent the tables.

In one of our last post we built a simple SQL wrapper with PHP. Now we are going to improve it a little bit. We area going to use a class Table instead of the table name. Why? Simple. We want to create triggers. OK we can create triggers directly in the database but sometimes our triggers need to perform operations outside the database, such as call a REST webservice, filesystem's logs or things like that.

He includes the updated code with the new "Table" class with methods that let you set up pre- and post-action hooks on each of the types (insert, delete, update) along with the rest of the library, there ready for the copy & pasting.

0 comments voice your opinion now!
sql wrapper tutorial table hook object


blog comments powered by Disqus

Similar Posts

WorkingSoftware.com.au: Configuring PHP4 and PHP5 to run concurrently on FreeBSD

SitePoint PHP Blog: 6 Reasons to Move to Laravel Homestead

TutToaster.com: How To Use, Style and Implement Wordpress Shortcodes

PHPMaster.com: An Intro to Virtual Proxies, Part 2

Refulz Blog: Yii Framework - Scenarios for Conditional Multiple Validation Rules


Community Events

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


library php7 symfony2 api performance community release opinion configure framework conference laravel language introduction application podcast series install example interview

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