note 14560 added to ref.strings.php
| From: | rs234 at cornell dot edu | Date: | Fri, 03 Aug 2001 21:31:36 +0000 |
| Subject: | note 14560 added to ref.strings.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16301@lists.php.net to get a copy of this message | ||
there's a problem when i used the addslashes function for my odbc connection... in order to fix
it, I used the htmlspecialchars($str_var, ENT_QUOTES); instead and it worked fine. example is as
follow:
// $str - a string w/ single quotes
$str = htmlspecialchars($str, ENT_QUOTES);
.
.
.
.
$sql = "<something> $str <something>";
<etc.>
http://www.php.net/manual/en/ref.strings.php