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

Volker Dusch's Blog:
References suck! - Let's fix MySqli prepared statements!
June 14, 2011 @ 11:46:55

Volker Dusch has a new post to his blog looking at the use of references in PHP (or lack there of) and what we, as end users of the language, can do about it. His example looks at mysqli prepared statements.

Even so not every PHP Developers knows WHY we don't use references pretty much every core function and every somewhat modern framework avoids them so people adapted this best practice. The leftovers in the PHP core, like sort() or str_replace(), are exceptions to the rule. So if the common consensus is, or at least 'should be', that we should not use references then maybe we should start looking for places where they hurt and how we could fix them?

He talks about prepared statements and one thing he sees that makes it a "hard sell" to developers needing a good way to query their databases. He points out the difference in code required between the normal MySQL calls and mysqli (hint: it's more) and shows how to use an abstraction layer to make things a bit easier. He points out the downfalls of using this approach, mainly the performance hit you get (from using his fetchAll method).

0 comments voice your opinion now!
references mysqli prepared statement performance abstraction


blog comments powered by Disqus

Similar Posts

David Coallier's Blog: Simple DBAL, PHP5, Light, Fast, Simple.

Marco Pivetta: Accessing private PHP class members without reflection

PHPMaster.com: Speeding Up Your CakePHP Websites

International PHP Magazine: Poll Question: The Biggest Advantage of PHP 5 is?

PHPMaster.com: PHP's Quest for Performance: From C to hhvm


Community Events











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


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

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