php.net |  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
 [2012-04-01 07:06 UTC] nick at ihighteam dot com
Description:
------------
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."

From: http://php.net/manual/en/mysqlnd-ms.plugin-ini-json.php

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-02 15:02 UTC] uw@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: uw
 [2012-05-02 15:02 UTC] uw@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Good one, Nick!

Fixed in 1.4. Please, see http://docs.php.net/manual/en/mysqlnd-ms.plugin-ini-json.php -> server_charset.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 11 02:01:24 2020 UTC