note 55686 added to function.addslashes

From: Date: Wed, 10 Aug 2005 15:58:47 +0000
Subject: note 55686 added to function.addslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-93380@lists.php.net to get a copy of this message
I prefer a command like this for dumping a binary content into a valid mysql insert command. <?php $SrcPathFile = 'mybinfile.dat'; $bindata = '0x'.bin2hex(fread(fopen($SrcPathFile, "rb"), filesize($SrcPathFile))); $writestring .= "$field=$bindata"; // Note that there is no quotes (e.g. myfield=0x00abdf3...) ?> This is a safe data insertion. ---- Manual Page -- http://www.php.net/manual/en/function.addslashes.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55686 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55686&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55686&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55686&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55686&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55686&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55686&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55686&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93380) next »