note 42411 added to function.addslashes

From: Date: Sat, 15 May 2004 15:11:19 +0000
Subject: note 42411 added to function.addslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-69648@lists.php.net to get a copy of this message
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 ;] ---- Manual Page -- http://www.php.net/manual/en/function.addslashes.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42411 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42411&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42411&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69648) next »