|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-22 14:13 UTC] danielc@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 20:00:01 2025 UTC |
Description: ------------ In the PEAR DB module, the quoteString function returns the string "NULL" when passed a null. This makes a literal "NULL" get written into the database which is a problem. For better backwards compatibility with the pre-quote() API please consider this implementation for pear/DB/common.php: function quoteString($string) { $string = $this->quote($string); if ($string == "NULL") return ""; if ($string{0} == "'") { return substr($string, 1, -1); } return $string; } Reproduce code: --------------- $val=$dbh->getOne("select null"); echo "The value is:", $dbh->quote($val); Expected result: ---------------- The value is: Actual result: -------------- The value is:NULL