some DB::quote() options?
| From: | Analysis & Solutions | Date: | Thu, 30 Oct 2003 01:07:24 +0000 |
| Subject: | some DB::quote() options? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-23129@lists.php.net to get a copy of this message | ||
Hi Folks:
I'd like to propose some ehnancements to the DB::quote() function. Adding
two parameters would be very helpful.
The first proposal is $null. It's would be optional and default to 'null'
If set to 'notnull' the method would return a blank string instead of
"NULL" This is helpful for fields has been defined as
"char() default '' NOT NULL"
The second proposal is $type. It would permit users to override PHP's
gettype() determinations. This is helpful for situations like when
someone is submitting a numeric value but it's going into a char() field
in the database.
While on this topic, I'm wondering why the string() method in
DB/common.php puts quotes around everything, regardless of data type.
This isn't "standard."
Enjoy,
--Dan
--
FREE scripts that make web and database programming easier
http://www.analysisandsolutions.com/software/
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409