Re: PDO - Cannot retrieve warnings with emulated prepares disabled [message #183527 is a reply to message #183518] |
Wed, 30 October 2013 00:57 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 10/29/2013 4:06 PM, Thomas 'PointedEars' Lahn wrote:
> 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?
>
Exactly. I did not say anything about PDO. But your head is too far up
your anus to understand.
>>> 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.
>
I highly doubt that. You're not that intelligent.
>>> “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
>
Sure you did. You said quote: "pdo_mysql" does _not_ use nor require
either "mysql" or the "mysqli" extension.... : Unqote. So since it
doesn't require any of the extensions provided by MySQL, the authors
must have written their own extension.
Or are you going to admit you're full of bullshit, as always?
BTW - have you told Richard Cornford "There is no javascript"? If not,
why not?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|