Subject Re: [firebird-php] Handling quote characters in Firebird/PHP
Author Helen Borrie
At 12:24 AM 2/03/2006, you wrote:
>I am running Firebird 1.5 Super Server on a Windows 2000 box with
>Apache/PHP4. When trying to enter text data into a Firebird database, I
>have specific stored procedures that handle the updating of various tables.
>Text data that contains a single quote character in it (ie. O'Connell, etc.)
>is causing errors in Firebird when executing the query. This is typically
>due to the fact that I put quotes around the text fields in order to send
>them as a arguments to the stored procedures.
>
>What is the best practice way of handling fields with single quote
>characters purposely entered into them, and getting this data into Firebird?

The SQL escape character for an apostrophe is another
apostrophe. Write a function (or search for one on the boards) that
applies a RegEx to your input data before it gets passed to the SQL
string or parameter, to double any apostrophes. (That's two
apostrophes, not a double-quote character).

From what I've seen, most php solutions assume that the apostrophe
is escaped using a backslash. This is "correct" for MySQL but it's
not standard. :-(

Helen