Unknown Sender <[EMAIL PROTECTED]> wrote:
As mentioned in another reply, in MySQL all fields can have quotes regardelss of
type. If you really need to tell, use this:
if(!is_numeric($value)) {
$value = "'" . $value . "'";
}
> 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
> [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php