Re: PDO - Cannot retrieve warnings with emulated prepares disabled [message #183512 is a reply to message #183509] |
Tue, 29 October 2013 15:26 |
Thomas Mlynarczyk
Messages: 131 Registered: September 2010
Karma:
|
Senior Member |
|
|
Thomas 'PointedEars' Lahn schrieb:
> I presume reading the changelog will tell.
I couldn't find anything relating to this issue there.
>>> 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.
Greetings,
Thomas
--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
|
|
|