<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: New PDO Behavior In PHP 5.2.1</title>
	<atom:link href="http://paul-m-jones.com/archives/243/feed" rel="self" type="application/rss+xml" />
	<link>http://paul-m-jones.com/archives/243?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-pdo-behavior-in-php-521</link>
	<description>It&#039;s not enough to be smart; you have to actually know things.</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:50:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: PHP, PDO en geen resultaten &#124; el73</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-409612</link>
		<dc:creator>PHP, PDO en geen resultaten &#124; el73</dc:creator>
		<pubDate>Mon, 27 Oct 2008 14:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-409612</guid>
		<description>[...] een betaalbare Belgische host met een degelijke PHP 5 installatie; pigs do fly). En wat blijkt, sinds PHP 5.2.1, wordt in dit voorbeeld 10 enkel de eerste keer aan :x [...]</description>
		<content:encoded><![CDATA[<p>[...] een betaalbare Belgische host met een degelijke PHP 5 installatie; pigs do fly). En wat blijkt, sinds PHP 5.2.1, wordt in dit voorbeeld 10 enkel de eerste keer aan :x [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rant-O-Matic &#187; Upgrading PHP&#8230; Good idea?</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-239855</link>
		<dc:creator>Rant-O-Matic &#187; Upgrading PHP&#8230; Good idea?</dc:creator>
		<pubDate>Tue, 08 Jan 2008 14:58:32 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-239855</guid>
		<description>[...] of back tracing you find out that there is a version problem. Adding to the pool of problems is this. Yet another version issue. Apparently in one version it looks like that the developers decided [...]</description>
		<content:encoded><![CDATA[<p>[...] of back tracing you find out that there is a version problem. Adding to the pool of problems is this. Yet another version issue. Apparently in one version it looks like that the developers decided [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pmjones</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-140500</link>
		<dc:creator>pmjones</dc:creator>
		<pubDate>Tue, 08 May 2007 16:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-140500</guid>
		<description>Hi Jay, thanks for commenting.  Yeah, I fully sympathize with Wez (et al) on the need for this change; security has to take first precedence.

When you say this, though: &quot;from the perspective of the PDO user, it *does* make sense to think that a *named* parameter would not need to be bound more than once, no?&quot; ... I must disagree a little.

I am not a database guru, so it seems to me that a &quot;:foo&quot; placeholder should be replaced with its respective value everywhere in the statement, not just the first time it shows up.  (See the first example I give in the article above.)  I think this becomes more-so the case when you get into things like &quot;UNION&quot; queries; why would I bind the same key-value pair more than once, if it&#039;s always the same value for the a particular key?

When it comes to binding *variables*, then I see the argument and agree completely.  But for replacement *values*, I don&#039;t so much.</description>
		<content:encoded><![CDATA[<p>Hi Jay, thanks for commenting.  Yeah, I fully sympathize with Wez (et al) on the need for this change; security has to take first precedence.</p>
<p>When you say this, though: &#8220;from the perspective of the PDO user, it *does* make sense to think that a *named* parameter would not need to be bound more than once, no?&#8221; &#8230; I must disagree a little.</p>
<p>I am not a database guru, so it seems to me that a &#8220;:foo&#8221; placeholder should be replaced with its respective value everywhere in the statement, not just the first time it shows up.  (See the first example I give in the article above.)  I think this becomes more-so the case when you get into things like &#8220;UNION&#8221; queries; why would I bind the same key-value pair more than once, if it&#8217;s always the same value for the a particular key?</p>
<p>When it comes to binding *variables*, then I see the argument and agree completely.  But for replacement *values*, I don&#8217;t so much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Pipes</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-140328</link>
		<dc:creator>Jay Pipes</dc:creator>
		<pubDate>Tue, 08 May 2007 03:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-140328</guid>
		<description>Hi!

Interesting post, and interesting comments.  Hacking on some older (as in 4 months old..) libraries tonight, I got bit by this change after upgrading my laptop to PDO 5.2.1... For me, the change affected code in a save() routine that built an INSERT ... VALUES ... ON DUPLICATE KEY UPDATE ... statement from an array of table fields.  Previously, a single named parameter worked fine for both the VALUES clause and the ON DUPLICATE KEY UPDATE clause.  Now, I&#039;ll have to hack in a version check and bind the parameters again for PDO &gt;= 5.2.1.  Not a huge deal, and I understand the reasoning behind the change.  Heck, MySQL certainly has had it&#039;s fair share of such happenings.

However, from the perspective of the PDO user, it *does* make sense to think that a *named* parameter would not need to be bound more than once, no?

Cheers,

Jay</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Interesting post, and interesting comments.  Hacking on some older (as in 4 months old..) libraries tonight, I got bit by this change after upgrading my laptop to PDO 5.2.1&#8230; For me, the change affected code in a save() routine that built an INSERT &#8230; VALUES &#8230; ON DUPLICATE KEY UPDATE &#8230; statement from an array of table fields.  Previously, a single named parameter worked fine for both the VALUES clause and the ON DUPLICATE KEY UPDATE clause.  Now, I&#8217;ll have to hack in a version check and bind the parameters again for PDO &gt;= 5.2.1.  Not a huge deal, and I understand the reasoning behind the change.  Heck, MySQL certainly has had it&#8217;s fair share of such happenings.</p>
<p>However, from the perspective of the PDO user, it *does* make sense to think that a *named* parameter would not need to be bound more than once, no?</p>
<p>Cheers,</p>
<p>Jay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-116222</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Fri, 02 Mar 2007 05:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-116222</guid>
		<description>As with previous posters, this &quot;small&quot; &quot;bug-fix&quot; is a fundamental change. The only reason I chose PDO over mysqli was the ability to name bind and bind one to many. 

Don&#039;t see a good reason why for bindValue cannot work for multiple placements without memory corruption. 

The primary goal is to make life easier for coders and this change does not in my opinion.</description>
		<content:encoded><![CDATA[<p>As with previous posters, this &#8220;small&#8221; &#8220;bug-fix&#8221; is a fundamental change. The only reason I chose PDO over mysqli was the ability to name bind and bind one to many. </p>
<p>Don&#8217;t see a good reason why for bindValue cannot work for multiple placements without memory corruption. </p>
<p>The primary goal is to make life easier for coders and this change does not in my opinion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-116035</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Thu, 01 Mar 2007 15:05:52 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-116035</guid>
		<description>Actually I find Wez reasoning quite surprising. So why dont we have a universal DSN format yet? Why is there support for cursors, which are not supported on all RDBMS? In the past your argument was that PDO is just a thin layer. Since when do you limit things to a lowest common denominator? I am just not understanding the pattern by which you make decisions Wez.

I have argued in the past for two different modes for PDO. Once that maximizes portability and specifically disallows features that are not portable. And one that tries to expose as much native functionality as possible. IMHO the long term goal of PDO must be to one day replace the native extensions. This is obviously only possible if we do not artificially limit any of the drivers.

However let me ask my question once more: Why does this apply to bindValue() as well?</description>
		<content:encoded><![CDATA[<p>Actually I find Wez reasoning quite surprising. So why dont we have a universal DSN format yet? Why is there support for cursors, which are not supported on all RDBMS? In the past your argument was that PDO is just a thin layer. Since when do you limit things to a lowest common denominator? I am just not understanding the pattern by which you make decisions Wez.</p>
<p>I have argued in the past for two different modes for PDO. Once that maximizes portability and specifically disallows features that are not portable. And one that tries to expose as much native functionality as possible. IMHO the long term goal of PDO must be to one day replace the native extensions. This is obviously only possible if we do not artificially limit any of the drivers.</p>
<p>However let me ask my question once more: Why does this apply to bindValue() as well?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul M. Jones &#187; Blog Archive &#187; Solar 0.27.0 and 0.27.1 Released</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-116033</link>
		<dc:creator>Paul M. Jones &#187; Blog Archive &#187; Solar 0.27.0 and 0.27.1 Released</dc:creator>
		<pubDate>Thu, 01 Mar 2007 14:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-116033</guid>
		<description>[...] Paul M. Jones If it&#8217;s worth doing, it&#8217;s worth over-doing.      &#171; New PDO Behavior In PHP 5.2.1 [...]</description>
		<content:encoded><![CDATA[<p>[...] Paul M. Jones If it&#8217;s worth doing, it&#8217;s worth over-doing.      &laquo; New PDO Behavior In PHP 5.2.1 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pmjones</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-115861</link>
		<dc:creator>pmjones</dc:creator>
		<pubDate>Thu, 01 Mar 2007 03:46:12 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-115861</guid>
		<description>Hi Wez --

Poor phrasing on my part about &quot;supported.&quot;  Perhaps &quot;the incorrect behavior was not explicitly disallowed&quot; is more correct?  ;-)

I completely agree that the &quot;new&quot; behavior is the right thing to do; security and stability have to be the primary goals.

The bite was not too bad, just unexpected -- and even then, nothing that we couldn&#039;t work around.  (Having a method in PDO that returns a list of the parsed placeholders, though, would be a wonderful addition; then there&#039;d be no need for the above regex routine, and I&#039;m sure it&#039;d be much faster.)

Finally, my many many thanks for creating and maintaining PDO in the first place; it&#039;s a great piece of work and makes my life a lot easier.  :-)</description>
		<content:encoded><![CDATA[<p>Hi Wez &#8211;</p>
<p>Poor phrasing on my part about &#8220;supported.&#8221;  Perhaps &#8220;the incorrect behavior was not explicitly disallowed&#8221; is more correct?  ;-)</p>
<p>I completely agree that the &#8220;new&#8221; behavior is the right thing to do; security and stability have to be the primary goals.</p>
<p>The bite was not too bad, just unexpected &#8212; and even then, nothing that we couldn&#8217;t work around.  (Having a method in PDO that returns a list of the parsed placeholders, though, would be a wonderful addition; then there&#8217;d be no need for the above regex routine, and I&#8217;m sure it&#8217;d be much faster.)</p>
<p>Finally, my many many thanks for creating and maintaining PDO in the first place; it&#8217;s a great piece of work and makes my life a lot easier.  :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wez</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-115859</link>
		<dc:creator>Wez</dc:creator>
		<pubDate>Thu, 01 Mar 2007 03:30:29 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-115859</guid>
		<description>It was never technically supported.  It just happened to work for the drivers that most people use.  This is (not very clearly) documented, and something that I mention in my PDO talks.

The change was made for two reasons; first and foremost, if you re-use the same variable in a bind, it is possible to induce a crash when using some drivers.  It&#039;s not possible to guarantee to do the right thing, and having a way to trigger a crash can sometimes be used as an attack vector for a security exploit.

The second reason is that of portability.  Some drivers would internally perform this check and error out.  If you code against the drivers that don&#039;t enforce this, then your code won&#039;t work on those that don&#039;t.

I&#039;m sorry that this bit you; it&#039;s hard to notice a change in the handling of &quot;bad&quot; uses if you don&#039;t use it that way.</description>
		<content:encoded><![CDATA[<p>It was never technically supported.  It just happened to work for the drivers that most people use.  This is (not very clearly) documented, and something that I mention in my PDO talks.</p>
<p>The change was made for two reasons; first and foremost, if you re-use the same variable in a bind, it is possible to induce a crash when using some drivers.  It&#8217;s not possible to guarantee to do the right thing, and having a way to trigger a crash can sometimes be used as an attack vector for a security exploit.</p>
<p>The second reason is that of portability.  Some drivers would internally perform this check and error out.  If you code against the drivers that don&#8217;t enforce this, then your code won&#8217;t work on those that don&#8217;t.</p>
<p>I&#8217;m sorry that this bit you; it&#8217;s hard to notice a change in the handling of &#8220;bad&#8221; uses if you don&#8217;t use it that way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis Swicegood</title>
		<link>http://paul-m-jones.com/archives/243/comment-page-1#comment-115802</link>
		<dc:creator>Travis Swicegood</dc:creator>
		<pubDate>Wed, 28 Feb 2007 22:04:33 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=243#comment-115802</guid>
		<description>Any change of getting a link to Wez&#039;s reasonings?  (Yes, I&#039;m too lazy to Google it...) ;-)</description>
		<content:encoded><![CDATA[<p>Any change of getting a link to Wez&#8217;s reasonings?  (Yes, I&#8217;m too lazy to Google it&#8230;) ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

