there is a program used to extract data from database in which binary data of image is stored. now it is required that this image data be extracted from database and be displayed as an image on to the browser. the code used is ...
<?
require("config.php3");
require("classes/dbquery.php3");
$connect=new db;
$connectid=$connect->open($database,$host,$dbuser,$dbpwd);
$imgsql="SELECT * FROM $table WHERE $field=$id";
$imgsqlrs=new query($imgsql);
$imgrow=$imgsqlrs->getrow();
Header( "Content-type: image/$imgrow[4]");
echo $imgrow[1];
?>
datastructure is...\
CREATE TABLE $table(
$field int(3) DEFAULT '0' NOT NULL,
pic longblob,
picwidth int(4),
picheight int(4),
picext varchar(4),
PRIMARY KEY ($field )
);
now the problem being faced is that this program is working on a windows platform and it seems to be not working for a unix/linux platform...
please reply if u have got any ideas on this..
regrads
shaju