<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 02:13:09 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Carson McDonald's Blog: PHP MySQLi and Multiple Prepared Statements]]></title>
      <guid>http://www.phpdeveloper.org/news/14029</guid>
      <link>http://www.phpdeveloper.org/news/14029</link>
      <description><![CDATA[<p>
When <i>Carson McDonald</i> 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 <a href="http://www.ioncannon.net/programming/889/php-mysqli-and-multiple-prepared-statements/">found a solution</a> thanks to the <a href="http://php.net/manual/en/mysqli-stmt.store-result.php">store result</a>.
</p>
<blockquote>
Details about this error can be found in the <a href="http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html">mysql docs</a>. 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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Mon, 15 Feb 2010 13:29:28 -0600</pubDate>
    </item>
  </channel>
</rss>
