Req #64844 [Opn->Nab]: PDO::quote() for mysql driver (wrong apostrophe replacing)

From: Date: Fri, 07 Jun 2013 09:55:59 +0000
Subject: Req #64844 [Opn->Nab]: PDO::quote() for mysql driver (wrong apostrophe replacing)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-179397@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64844&edit=1

 ID:                 64844
 Updated by:         uw@php.net
 Reported by:        mariusz dot gomse at baobaz dot com
 Summary:            PDO::quote() for mysql driver (wrong apostrophe
                     replacing)
-Status:             Open
+Status:             Not a bug
 Type:               Feature/Change Request
 Package:            PDO related
 Operating System:   Irrelevant
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

The cited bug is an InnoDB server bug. Unrelated to driver.


Previous Comments:
------------------------------------------------------------------------
[2013-05-15 15:57:57] mariusz dot gomse at baobaz dot com

Description:
------------
According to http://bugs.mysql.com/bug.php?id=61656 mysql bug
PDO::quote() method shouldn't change ' to \' for mysql driver. Should change for
''.

Test script:
---------------
<?php 

$tmp = "Let's go!";
$pdo = new PDO("mysql:host=localhost;initStatements=SET NAMES
utf8;model=mysql4;type=pdo_mysql;pdoType=;active=1", 'root', '', array());
echo $pdo->quote($tmp);

?>

Expected result:
----------------
'Let''s go!'

Actual result:
--------------
'Let\'s go!'


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64844&edit=1


Thread (2 messages)

« previous php.bugs (#179397) next »