my code is:
display.php
Expand|Select|Wrap|Line Numbers
- <img src="displayimg.php?co=<?php echo $t;?>">
- \\$t is some id value i am sending to displayimg.php
Expand|Select|Wrap|Line Numbers
- <?php
- $cpno=$_GET['co'];
- require_once('../includes/DbConnector.php');
- $connector = new DbConnector();
- $resim=$connector->query1("select img from image where compno=$1",array($cpno));
- $im1=$connector->fetchArray($resim);
- $data=pg_unescape_bytea(($im1[0]));
- header('Content-type: image/jpeg');
- echo $im1[0];
- ?>
code which i used to store image is..
Expand|Select|Wrap|Line Numbers
- $data = file_get_contents($newname);
- $imgdata =pg_escape_bytea($data);
- require_once('../includes/DbConnector.php');
- $connector = new DbConnector();
- $connector->query1("INSERT INTO image VALUES($1,$2)",array($row[0],$imgdata));
i am sure that there is no syntactical parse errors..but my questions are...
Did i went any thing wrong in inserting??
Is there any setting in php.ini or httpd.conf files to display??
Please suggest me if i went wrong at any point...