[PHP-DB] Escaping queries in php using InterBase

2001-08-22 Thread Yves Glodt

Hello,

I'm in trouble with my current project which uses Interbase as backend.
(php.ini: magic_quotes_sybase = On)
When I insert a string containing a ', like Beverly D'Angelo,
php saves it with two '
When I insert it with two ', it gets saved with four '

Short: php multiplies all the ' by factor 2.
e.g.:

Select after inserting the string:
Beverly D''Angelo

Select after first update
Beverly DAngelo

Select after second update
Beverly DAngelo

Select after third update
Beverly DAngelo


What can I do?
I do not want to write an ugly function to handle this, isn't there 
something php/ib-native

thank you,

yves

--
PHP Database 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]




Re: [PHP-DB] Escaping queries in php using InterBase

2001-08-22 Thread Patrik Wallstrom

On Wed, 22 Aug 2001, Yves Glodt wrote:

 Hello,

 I'm in trouble with my current project which uses Interbase as backend.
 (php.ini: magic_quotes_sybase = On)
 When I insert a string containing a ', like Beverly D'Angelo,
 php saves it with two '
 When I insert it with two ', it gets saved with four '

[...]

I have always wondered why there is no mysql specifig quoting functions in
php. Here is what I use:

function myslashes($content = ) {
$content = str_replace(\\,,$content);
$content = str_replace(',\\',$content);
return $content;
}

I guess Interbase also uses backslash for quoting?

--
 patrik wallstrom |  f o o d f i g h t
 tel: +46-8-6188428   |  s t o c k h o l m
 gsm: +46-709580442   |  - - - - - - - - -


-- 
PHP Database 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]