note 20865 deleted from function.ociparse by didou
| From: | didou@php.net | Date: | Tue, 12 Aug 2003 08:30:29 +0000 |
| Subject: | note 20865 deleted from function.ociparse by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53955@lists.php.net to get a copy of this message | ||
Note Submitter: david@littlesystems.com.au
----
If you've got an SQL statement with apostrophes, for example, insert into table values
('dave's comments')...
Then you need to escape apostrophes when using Oracle 8. This is done with another apostrophe, and
not a backslash.
So, if your environment variables come default with backslashs, you can remove them with: $my_var =
stripslashes($my_var);
Then, to replace all occurances of single apostrophes with double apostrophes, use: $my_var =
str_replace("'","''",$my_var);
If the above mixture of double and single apostrophes is too hard to read... it's a single
apostrophe within double apostrophes, and then two single apostrophes within double apostrophes.