note 42411 deleted from function.addslashes by nlopess
| From: | nlopess@php.net | Date: | Tue, 18 May 2004 12:52:56 +0000 |
| Subject: | note 42411 deleted from function.addslashes by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69752@lists.php.net to get a copy of this message | ||
Note Submitter: php@jurgutis.lm.lt
----
hi folks,
i have good solution for inserting string data into db, and when u select data u dont have prepeare
it for output. here is my code i am using:
$text = $request->getParameter(text );
$text = str_replace ( chr(0), "\\0", $text );
$text = ereg_replace ( "\\\\", "\\\\", $text );
$text = ereg_replace( "'","\\'", $text );
and then use sql insert
enjoy ;]