News Feed
Sections




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

Davey Shafik's Blog:
Debugging PDO Prepared Statements
May 20, 2009 @ 09:35:01

In a recent post to his blog, Davey Shafik looks at solving something that has "always bugged him about using prepared statements" - getting the actual query it used back out.

Today, a friend asking me if it was possible to get a prepared statement back from PDO with the values placeholders replaced, finally caught me in a moment where I could do something about it. I wrote a thin PDO wrapper class that will [imperfectly, I'm sure] return the completed query.

His class (complete code included in the post) includes a getSQL() method that hands you back the results of your bound parameter query as a string. A few examples of its use are also included.

0 comments voice your opinion now!
sql bind debug pdo


blog comments powered by Disqus

Similar Posts

Carsten Lucke's Blog: Debugging PHP with free tools (PDT + XDebug2)

Community News: Serendipity 1.1.3 and 1.2-beta2 released due to SQL exploit

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

Marco Tabini's Blog: 5 PHP 5 features you can't afford to ignore

Agile Toolkit Blog: Which PHP Framework is the Fastest?


Community Events





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


laravel community framework series list release install interview package language api tips introduction deployment podcast zendserver library update opinion symfony

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