note 20865 added to function.ociparse

From: Date: Fri, 19 Apr 2002 11:45:13 +0000
Subject: note 20865 added to function.ociparse
Groups: php.notes 
Request: Send a blank email to php-notes+get-29569@lists.php.net to get a copy of this message
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 = ereg_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. -- http://www.php.net/manual/en/function.ociparse.php http://master.php.net/manage/user-notes.php?action=edit+20865 http://master.php.net/manage/user-notes.php?action=delete+20865 http://master.php.net/manage/user-notes.php?action=reject+20865

« previous php.notes (#29569) next »