|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61590 mysql_real_escape_string() doesn't like mysqlnd_ms
Submitted: 2012-04-01 07:06 UTC Modified: 2012-05-02 15:02 UTC
From: nick at ihighteam dot com Assigned: uw (profile)
Status: Closed Package: mysqlnd_ms (PECL)
PHP Version: 5.3.10 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nick at ihighteam dot com
New email:
PHP Version: OS:


 [2012-04-01 07:06 UTC] nick at ihighteam dot com
This may already be known:  mysql_real_escape_string(), unlike mysql_escape_string(), requires a link identifier or an open connection to derive the character set.  So, mysql_real_escape_string() doesn't seem to work with mysqlnd_ms.  According to this comment, lazy_connections must be disabled:

"In order to use doctrine 2.1+ with mysqlnd_ms lazy_connections must be disabled. Otherwise a warning will be thrown & no query processed:
Warning: PDOStatement::execute(): (mysqlnd_ms) string escaping doesn't work without established connection."


What would be the best way to make these work together without disabling lazy connections?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-02 15:02 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: uw
 [2012-05-02 15:02 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Good one, Nick!

Fixed in 1.4. Please, see -> server_charset.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 11 17:01:27 2020 UTC