RE: [PHP-DB] To quote or not to quote?
| From: | Jeroen ten Berge | Date: | Tue, 10 Oct 2000 05:40:01 +0000 |
| Subject: | RE: [PHP-DB] To quote or not to quote? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3454@lists.php.net to get a copy of this message | ||
I might be wrong, but I think you can always use quotes, either numeric or
strings.
-----Original Message-----
From: Patrick Doyle [mailto:doylep@eecg.toronto.edu]
Sent: Monday, October 09, 2000 7:37 PM
To: php-db@lists.php.net
Subject: [PHP-DB] To quote or not to quote?
I guess this is mostly a MySQL question, but perhaps PHP has a solution...
I would like a foolproof way to determine whether a data value needs to be
quoted. Numeric data doesn't need quotes, but string data does.
I could use mysql_field_type and check if it's integer, float, double,
real, etc., but this seems fragile. I could easily miss one, or a new
version of MySQL could add a new one.
So how can I get the equivalent of a "mysql_needs_quotes" function?
--
Patrick Doyle
doylep@eecg.utoronto.ca
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net