php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56757 PDO::quote() returns NULL instead of false
Submitted: 2005-12-29 06:34 UTC Modified: 2006-03-23 14:03 UTC
From: mfischer@php.net Assigned:
Status: Closed Package: PDO_ODBC (PECL)
PHP Version: 5_1 CVS-2005-12-29 OS: Windows
Private report: No CVE-ID: None
 [2005-12-29 06:34 UTC] mfischer@php.net
Description:
------------
PDO::quote() returns NULL instead of false. Maybe only the documentation is wrong at http://at.php.net/manual/en/function.pdo-quote.php .

I currently have to use

function dbQuote($sValue) {
  return "'" . str_replace("'", "''", $sValue) . "'";
}

to quote the value. I guess the quote style depends on the real driver so that's the reason it can't be done by PDO?

Reproduce code:
---------------
$p = new PDO('odbc:driver={Microsoft Access Driver (*.mdb)};Dbq=beispieldatenbank.mdb');
var_dump($p->quote("some\\'test"));

Expected result:
----------------
bool(false)

Actual result:
--------------
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-23 14:03 UTC] tony2001 at phpclub dot net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC