Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #11633
| Message-ID | <3184384.4xQAoNiki8@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2013-10-29 21:06 +0100 |
| Subject | Re: PDO - Cannot retrieve warnings with emulated prepares disabled |
| Newsgroups | comp.lang.php |
| References | (2 earlier) <l4o9qm$1u3$1@news.albasani.net> <2185476.vkglFbDy2O@PointedEars.de> <l4ok2h$n2u$1@news.albasani.net> <2131967.hbSm1AV4dr@PointedEars.de> <l4p3qg$pe9$1@dont-email.me> |
Jerry Stuckle wrote:
> On 10/29/2013 2:19 PM, Thomas 'PointedEars' Lahn wrote:
>> Thomas Mlynarczyk wrote:
>>> Thomas 'PointedEars' Lahn schrieb:
>>>> I presume reading the changelog will tell.
>>>
>>> I couldn't find anything relating to this issue there.
>>
>> Too bad. UTSL?
>>
>>>>>> PDO::ATTR_EMULATE_PREPARES == false should be the effective default
>>>>>> for PDO_MySQL unless you are using an ancient MySQL version (why?)
>>>>>> that does not support Prepared Statements.
>>>>> My MySQL version does support them. Still, PDO's default seems to be
>>>>> "on" for the emulation.
>>>>
>>>> Not here; the attribute is not even supported:
>>>>
>>>> $ php -r '
>>>> $pdo = new PDO("mysql:host=localhost", "…", "…");
>>>> var_dump($pdo->getAttribute(PDO::ATTR_EMULATE_PREPARES));'
>>>> PHP Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not
>>>> support this function: driver does not support that attribute in
>>>> Command line code on line 3
>>>> PHP Stack trace:
>>>> PHP 1. {main}() Command line code:0
>>>> PHP 2. PDO->getAttribute() Command line code:3
>>>> bool(false)
>>>
>>> Yes, I get that error too -- which is all the more confusing, since
>>> otherwise the behaviour with PDO::ATTR_EMULATE_PREPARES == false is
>>> consistent with the assumption that prepared statements are indeed
>>> supported. See my reply to Jerry.
>>
>> Both Jerry and you are wrong.
>>
>> Prepared statements have been supported in MySQL since version 4.1 (as
>> you can read in the MySQL manual), and with the “pdo_mysql” extension
>> since its
>> first version (as you can read in the PHP manual). Naturally, therefore
>> they have always been supported with the “mysql” and “mysqli” extensions
>> *too*, provided your MySQL client library and the MySQL server accessed
>> with it were recent enough.
>
> I was not discussing the pdo_mysql extension. I was discussing the
> mysql_extension - which does NOT support prepared statements. And
> pdo_mysql in PHP 4.1 only emulated prepared statements; it did not
> support the MySQL version of prepared statements directly.
You have written, quote:
| I could be wrong, but from my experience, the mysql driver has never
| supported prepared statements, while the mysqli driver has always
| supported them. This is why PDO has to emulate the prepared statements.
End of quote.
Since you are so fond of scatological references, here is one for you:
You have written bullshit. Can you at least, for once, stand by that?
>> Jerry is also confusing “mysql”, “mysqli”, and “pdo_mysql”, which are
>> *separate* ext ensions (you are using the latter). *You* are confusing
>> the MySQL client (library) – that is *used by* a database driver – with a
>> database driver (for PHP).
>
> No, I am not. If I had meant pdo_mysql, I would have SAID pdo_mysql.
You have said pdo_mysql had to emulate prepared statements because some
“mysql driver” was not capable. This is bullshit.
>> “pdo_mysql” is a PHP extension that provides a PDO driver (a database-
>> specific driver that implements the PDO interface as provided by the
>> “pdo” PHP extension); “mysql” and “mysqli” are PHP extensions that
>> provide only MySQL drivers.
>
> Wow - you can copy and paste!
I have written this from scratch, stupid.
>> “pdo_mysql” does _not_ use nor require either the “mysql” or the “mysqli”
>> extension. As a result, if you have “pdo_mysql” loaded (which is only
>> possible if you load “pdo” first), and no applications on your server
>> that use the mysql*_* functions/methods, you can disable the other two
>> without
>> your applications that use “pdo_mysql” stopping to function. BTDT.
>
> You mean the PDO authors wrote their own mysql client library?
I have said nothing of the sort. You have not even understood the
difference between a database driver and a database client library despite
it has been given to you *in graphical form*. How stupid are you anyway?
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-28 23:30 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-29 13:10 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Tim Streater <timstreater@greenbee.net> - 2013-10-29 12:23 +0000
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-29 13:31 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-29 13:47 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-29 16:26 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-29 19:19 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 15:55 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-29 21:06 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 20:57 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Christoph Michael Becker <cmbecker69@arcor.de> - 2013-10-30 02:59 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 22:04 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 08:58 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-29 16:22 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 16:09 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-29 21:50 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 21:01 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-29 23:11 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-30 01:12 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-30 15:38 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Jerry Stuckle <jstucklex@attglobal.net> - 2013-10-29 21:10 -0400
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-30 15:51 +0100
Re: PDO - Cannot retrieve warnings with emulated prepares disabled Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-10-30 21:09 +0100
csiph-web