News Feed
Sections




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

Carson McDonald's Blog:
PHP MySQLi and Multiple Prepared Statements
February 15, 2010 @ 13:29:28

When Carson McDonald tried to get multiple prepared statements to work in his MySQLi code for his application, he got a "commands out of sync" error. Luckily, he's found a solution thanks to the store result.

Details about this error can be found in the mysql docs. Reading those details makes it clear that the result sets of a prepared statement execution need to be fetched completely before executing another prepared statement on the same connection.

He gives code snippets that are "before" and "after" examples of what he had to change to get things working. Each time its executed, the "store_result" call is made and the result set is pulled out of the prepared statement.

1 comment voice your opinion now!
prepared statement tutorial storeresult mysqli


blog comments powered by Disqus

Similar Posts

Rob Allen: Setting up Zend Server 6 on OS X for PHP development

PHPRiot.com: Zend Framework 101: Zend_Registry

Gonzalo Ayuso: Token based authentication with Silex and AngularJS

PHPMaster.com: Patterns for Flexible View Handling, Part 2 - Using Decorators

PHPBuilder.com: Using the PEAR Pager Package to Paginate MySQL Results


Community Events





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


list conference version composer introduction language configure unittest symfony voicesoftheelephpant threedevsandamaybe podcast interview api community release series framework opinion laravel

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