<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: PHP database interfaces: PDO or PDBC?</title>
	<atom:link href="http://blogs.mysql.com/kaj/2005/09/27/php-database-interfaces-pdo-or-pdbc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mysql.com/kaj/2005/09/27/php-database-interfaces-pdo-or-pdbc/</link>
	<description>MySQL, FOSS, Sun and Community plus a dash of running and mountaineering</description>
	<pubDate>Sun, 12 Oct 2008 12:46:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Andrey Hristov</title>
		<link>http://blogs.mysql.com/kaj/2005/09/27/php-database-interfaces-pdo-or-pdbc/#comment-20</link>
		<dc:creator>Andrey Hristov</dc:creator>
		<pubDate>Fri, 07 Oct 2005 13:51:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.planetmysql.org/kaj/?p=10#comment-20</guid>
		<description>Hi Lukas,
I will separate my answer in 2 parts.
1) mysqli had problems with LOBs during fetch which were addressed months ago. There is "problem" with the max_length not updated by default by libmysql because this hurts performance. In this case the max length of a column has to be allocated, e.g. for MEDIUMBLOB it's 16M. I have patched  ext/mysqli before to sense whethere there are
BLOBS (BLOB and MEDIUMBLOB) and activate the update of max_length in the MYSQL_BIND structure. This
makes the queries slow but does not eat  a lot of memory (if there are at max 2000bytes in a MEDIUMBLOB only 2000bytes will be malloced instead of 16M). However, to do get this
effect and not explosive results one has to follow specific order of function calls - this is unfortunately undocumented because I have experience with the PHP doc system.
Related PHP bug is http://bugs.php.net/bug.php?id=32013
The let update of max_length to work one has to use buffered queries (store_result()) and not unbuffered queries, because in the latter case there is no way to get the right max_length (the server won't send such info). The right order is 
prepare()
execute()
store_result()
bind_result()

What's important is that store_result() is executed before bind_result() otherwise the memory saving won't work. Otherwise, from working point of view it does not matter the
order these 2 functions(methods) are called.

2)Going  back to the issue you have. I looked at the MDB2 source and saw you experience a problem by executing a query which binds LOBs are params. Unfortunately, we are not aware of a problem and we would appreciate more information given as feedback to fix the problem you experience.</description>
		<content:encoded><![CDATA[<p>Hi Lukas,<br />
I will separate my answer in 2 parts.<br />
1) mysqli had problems with LOBs during fetch which were addressed months ago. There is &#8220;problem&#8221; with the max_length not updated by default by libmysql because this hurts performance. In this case the max length of a column has to be allocated, e.g. for MEDIUMBLOB it&#8217;s 16M. I have patched  ext/mysqli before to sense whethere there are<br />
BLOBS (BLOB and MEDIUMBLOB) and activate the update of max_length in the MYSQL_BIND structure. This<br />
makes the queries slow but does not eat  a lot of memory (if there are at max 2000bytes in a MEDIUMBLOB only 2000bytes will be malloced instead of 16M). However, to do get this<br />
effect and not explosive results one has to follow specific order of function calls - this is unfortunately undocumented because I have experience with the PHP doc system.<br />
Related PHP bug is <a href="http://bugs.php.net/bug.php?id=32013" rel="nofollow">http://bugs.php.net/bug.php?id=32013</a><br />
The let update of max_length to work one has to use buffered queries (store_result()) and not unbuffered queries, because in the latter case there is no way to get the right max_length (the server won&#8217;t send such info). The right order is<br />
prepare()<br />
execute()<br />
store_result()<br />
bind_result()</p>
<p>What&#8217;s important is that store_result() is executed before bind_result() otherwise the memory saving won&#8217;t work. Otherwise, from working point of view it does not matter the<br />
order these 2 functions(methods) are called.</p>
<p>2)Going  back to the issue you have. I looked at the MDB2 source and saw you experience a problem by executing a query which binds LOBs are params. Unfortunately, we are not aware of a problem and we would appreciate more information given as feedback to fix the problem you experience.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://blogs.mysql.com/kaj/2005/09/27/php-database-interfaces-pdo-or-pdbc/#comment-19</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Fri, 07 Oct 2005 09:17:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.planetmysql.org/kaj/?p=10#comment-19</guid>
		<description>While on the subject of MySQL php APIs. A blog post of mine (http://pooteeweet.org/blog/243) that got syndicated on planetmysql and planetphp about LOB support in mysqli went unanswered. I think this gives some indication of the level of adoption.</description>
		<content:encoded><![CDATA[<p>While on the subject of MySQL php APIs. A blog post of mine (http://pooteeweet.org/blog/243) that got syndicated on planetmysql and planetphp about LOB support in mysqli went unanswered. I think this gives some indication of the level of adoption.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://blogs.mysql.com/kaj/2005/09/27/php-database-interfaces-pdo-or-pdbc/#comment-12</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Wed, 28 Sep 2005 08:46:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.planetmysql.org/kaj/?p=10#comment-12</guid>
		<description>PDO was always planned as a thin layer as a first step. The idea was that higher level things could be build ontop of PDO. I originally planned to move over PEAR::MDB2 (which features alot of portability features like datatype abstraction, schema reading and management etc.) over to the PDO API to make it possible to provide PDO based drivers while remaining compatible with PHP4. However the work involved in making the necessary changes were just too large so once I finish up MDB2 its time to start a PDO based alternative .. be it in userland or be it in C.</description>
		<content:encoded><![CDATA[<p>PDO was always planned as a thin layer as a first step. The idea was that higher level things could be build ontop of PDO. I originally planned to move over PEAR::MDB2 (which features alot of portability features like datatype abstraction, schema reading and management etc.) over to the PDO API to make it possible to provide PDO based drivers while remaining compatible with PHP4. However the work involved in making the necessary changes were just too large so once I finish up MDB2 its time to start a PDO based alternative .. be it in userland or be it in C.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hermann van der Loy</title>
		<link>http://blogs.mysql.com/kaj/2005/09/27/php-database-interfaces-pdo-or-pdbc/#comment-11</link>
		<dc:creator>Hermann van der Loy</dc:creator>
		<pubDate>Tue, 27 Sep 2005 21:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.planetmysql.org/kaj/?p=10#comment-11</guid>
		<description>From my personal experience in 2 of my projects where I tried to use PDO, I don't see any benefit of using PDO. I don't have to deal with different function names (which is sometimes a pita), but all the differences between the various RDBMS we have to support is still in my code. That makes it hard to maintain.
PDBC (I assume it's a JDBC pendant) implemented in PHP would cover most of the problems in one function call ( JDBC 3.0 specs cover mostly everything!), and it would be much more userfriendly.

Rewriting an existing PHP application in PDBC might be a lot of work, but for new projects it would be really cool.</description>
		<content:encoded><![CDATA[<p>From my personal experience in 2 of my projects where I tried to use PDO, I don&#8217;t see any benefit of using PDO. I don&#8217;t have to deal with different function names (which is sometimes a pita), but all the differences between the various RDBMS we have to support is still in my code. That makes it hard to maintain.<br />
PDBC (I assume it&#8217;s a JDBC pendant) implemented in PHP would cover most of the problems in one function call ( JDBC 3.0 specs cover mostly everything!), and it would be much more userfriendly.</p>
<p>Rewriting an existing PHP application in PDBC might be a lot of work, but for new projects it would be really cool.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
