Quote "draft"
| From: | Tomas V.V.Cox | Date: | Tue, 10 Jul 2001 11:04:41 +0000 |
| Subject: | Quote "draft" | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-612@lists.php.net to get a copy of this message | ||
Hi,
I present here my idea on the quote string system that I plan to
implement based on the ideas given here.
- The quoteString() method should return "NULL" when the value is equal
to null (php constant) or else an escaped string.
- Change "quoteString" method name to only "quote" (preserving the first
one as an alias for compat issues).
- Add a new placeholder char, for example "#" (please propose others). A
value in the position of a "#" should be returned without changes (for
example to not escape native SQL functions: insert into date ('id',
'date') values (?, #) with an array => (1, NOW())).
- Change common::quoteString() to support the null stuff and change the
escape function to str_replace("'", "''", $string); (ISO SQL 2
specs).
- Add where needed extensions::quote() method. I can do pgsql and mysql.
Comments, ideas, problems, votes are welcome :)
Tomas V.V.Cox