Re: Quoting strings
| From: | Andrey Hristov | Date: | Thu, 29 Nov 2001 11:12:50 +0000 |
| Subject: | Re: Quoting strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76003@lists.php.net to get a copy of this message | ||
$sql="insert into some_table
(".stripslashes(mysql_escape_string($your_var)).");";
Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
----- Original Message -----
From: "Jason Rennie" <jwrennie@bigpond.com>
Cc: <php-general@lists.php.net>
Sent: Thursday, November 29, 2001 2:12 PM
Subject: [PHP] Quoting strings
> Hi all,
>
> I have a fnction that needs to quote a strings in php to make them easy to
> stick into an mysql db.
>
> I need to do basically "$msg", which is easy enough, but I would like to
> not quote strings that are already quoted and also escape any single or
> double quotes in the string.
>
> IS there a regex to do this that anybody knows of, or a php function that
> i;ve missed ?
>
> Ideas anybody ?
>
> Thanks in advance
>
> Jason
>
> --
> Hofstadter's Law : "It always takes longer than you expect, even when you
> take Hofstadter's Law into account."
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>