note 79415 added to function.bin2hex

From: Date: Mon, 26 Nov 2007 10:37:57 +0000
Subject: note 79415 added to function.bin2hex
Groups: php.notes 
Request: Send a blank email to php-notes+get-132570@lists.php.net to get a copy of this message
hex2bin can be useful to insert data into BLOB binary fields. for example if you want to insert the content of a file : <?php $filename = '/foo/bar'; $bin_content = fread(fopen($filename,"r"),filesize($filename)); // use the usual mysql_connect() function $insert_query = "INSERT INTO mytable (blob_field) VALUES ('".bin2hex($bin_content)."')"; mysql_query($insert_query); ?> ---- Server IP: 195.221.21.36 Probable Submitter: 82.123.174.53 ---- Manual Page -- http://www.php.net/manual/en/function.bin2hex.php Edit -- https://master.php.net/note/edit/79415 Del: integrated -- https://master.php.net/note/delete/79415/integrated Del: useless -- https://master.php.net/note/delete/79415/useless Del: bad code -- https://master.php.net/note/delete/79415/bad+code Del: spam -- https://master.php.net/note/delete/79415/spam Del: non-english -- https://master.php.net/note/delete/79415/non-english Del: in docs -- https://master.php.net/note/delete/79415/in+docs Del: other reasons-- https://master.php.net/note/delete/79415 Reject -- https://master.php.net/note/reject/79415 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132570) next »