note 5190 deleted from function.odbc-exec by jimw
| From: | jimw@php.net | Date: | Fri, 14 Dec 2001 19:21:28 +0000 |
| Subject: | note 5190 deleted from function.odbc-exec by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22640@lists.php.net to get a copy of this message | ||
When doing my first odbc/Access site I noticed that addslashes wasn't working and I was getting
errors if a string that I was inserting contained a ' or a ". These functions were donated
to me by Phil Driscoll and he said I should put them here also
function AccessAddSlashes($S)
{
$S=str_replace("\\'","''",$S);
$S=str_replace("\\\"","\"\"",$S);
return $S;
}
function AccessStripSlashes($S)
{
$S=str_replace("\"\"","\\\"",$S);
$S=stripslashes($S);
return $S;
}
They worked for me.