News Feed
Sections




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

Bob Majdak:
On SQL in PHP
May 16, 2013 @ 10:11:29

In a new post to his site Bob Majdak looks at using SQL in PHP and some of the challenges he's come across (some of them with his own tools). He talks about things line inline SQL, loading SQL by unique key or creating a "build object".

There is no right or wrong way, but no matter what there is no *pretty* way to do SQL inside of a PHP application. I have been having a personal debate with myself all week about how to make SQL statements nicer in an application without going to a huge DBAL package like Doctrine.

He looks at each idea and provides some of the pros and cons about each of them, noting that he hasn't quite decided on which is the best method. Some sample code is included to help clarify the points, showing the "find by unique key" version and how a more complex query might be created with the "builder object."

0 comments voice your opinion now!
sql load unique key build object pros cons method inline

Link: http://catch404.net/2013/05/on-sql-in-php

blog comments powered by Disqus

Similar Posts

IBM developerWorks: What's new in PHP V5.3, Part 1: Changes to the object interface

PHP Web Services Blog: Payload the Way You Want with PHP5 built-in SOAP

PHPPro.org: SQL Intro, Reciprocal Links & Finding Links with DOM

Zend Developer Zone: The ZendCon Sessions Episode 17: SQL Query Tuning: The Legend of Drunken Query

PHPImpact Blog: Static Factories vs Public Constructors


Community Events





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


library bugfix developer threedevsandamaybe list series install release interview community wordpress language configure laravel code podcast api application introduction framework

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