PHP 4.0 Bug #9274: Error with inserting a binary data into database

From: Date: Thu, 15 Feb 2001 11:35:56 +0000
Subject: PHP 4.0 Bug #9274: Error with inserting a binary data into database
Groups: php.dev 
Request: Send a blank email to php-dev+get-46634@lists.php.net to get a copy of this message
From: mgx@frcatel.fri.utc.sk Operating system: Win XX PHP version: 4.0.4pl1 PHP Bug Type: MySQL related Bug description: Error with inserting a binary data into database error occured only in PHP compiled as a module on WIn95,98 php from default win installation, no changes in php.ini tested on many computers problem occured while inserting images (binary data into database). Functional script under OS LINUX don't work, because process of importing a binary data (for example gif image) is stopped when PHP detect some 'special' character. the same thing happend while trying to open binary data with file functions good code /tested on Linux and on cgi version of php under win/ create database pokus; create table pokus(pole blob); insert.php - it doesnt import whole image! <? $subor = "b.gif"; $fp = fopen($subor, "r"); $data = addslashes(fread($fp, filesize($subor))); fclose($fp); $data = "insert into pokus values ('$data')"; $conn = mysql_connect("localhost", "root", "root"); $vysledok = mysql_db_query("pokus", $data); ?> script for showing image <? Header("Content-type: image/gif"); $conn = mysql_connect("localhost", "root", "root"); $vysledok = mysql_db_query("pokus", "select * from pokus"); $z = mysql_fetch_array($vysledok); echo $z[pole]; ?> -- Edit Bug report at: http://bugs.php.net/?id=9274&edit=1

« previous php.dev (#46634) next »