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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to