Re: Quotes
| From: | Philip Olson | Date: | Sun, 14 Jan 2001 19:04:56 +0000 |
| Subject: | Re: Quotes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34489@lists.php.net to get a copy of this message | ||
Look into functions stripslashes() and addslashes() as well as the setting
magic_quotes_gpc :
http://www.php.net/manual/en/function.addslashes.php
http://www.php.net/manual/en/configuration.php#ini.magic-quotes-gpc
But quite simple, addslashes($foo); will addslashes before the quotes
within $foo which will put it into the database nicely. If you have
magic_quotes_gpc on then this should be automatic (see manual for when).
Philip
On Sun, 14 Jan 2001, rodrigo wrote:
> I recently came across this problem and I am sure that there is a quick
> fix for it. I need a solution to the quotes problem when sending
> queries. I use single quotes to construct my SQL queries. This worked
> fine since the data entered into the DB was all in spanish.
>
> However, yesterday I was typing in an English name that had a single
> quote (say, like O'reilly) and the SQL querie was all wrong.
>
> What is the solution to this? Thanks in advance.
> --
> ************************************
> Ivan R. Quintero E.* (507)228-3477
> Aptdo 1263 * (507)228-9105
> Balboa, Ancon * 640-0370
> Republic of Panama *
> ************************************
>
> --
> 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
>