Results 1 to 6 of 6

Thread: Database image retreival incomplete *RESOLVED*

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    425

    Question Database image retreival incomplete *RESOLVED*

    Hello ppl,

    I have a problem, ofcourse else I wouldn't start a tread. *sigh*
    Anyway, I've created a PHP script that uploads an image. This image is handled and strored in the MySQL database. This works, and I know that because when I laod my Graphical MySQL Front application I can see the whole image in the 'BLOB' field.

    Nou, my php retreives this image from the database and should display it on my website. The problem is I get only half the image, the rest is collored green, red and blue. What is wrong here? How can I fix this?

    My image.php:
    Code:
    <?php
    	$NewsID = $_REQUEST['NewsID'];
    	Include("DbData.inc");
    	$db = mysql_connect($DbUrl, $DbUserName, $DbPwd);
    	mysql_select_db($DbName,$db);
    	$result = mysql_query("SELECT NewsImageType, NewsImageSize, NewsImageName, NewsImageData FROM News WHERE NewsID=$NewsID",$db);
    	$myrow = mysql_fetch_array($result);
    	
    	header("Content-type: ".$myrow["NewsImageType"]);
    	header("Content-length: ".$myrow["NewsImageSize"]);
    	header("X-Image-ID: ".$myrow["NewsImageName"]);
    	echo $myrow["NewsImageData"];
    ?>
    The DbData.Inc is the file where the connection settings reside... And connecting to the database works OK everywhere else.

    I call this image: echo "<p><IMG SRC=image.php?NewsID=".$SubjectName."></p>";

    I get only half my image back...

    Can anyone please help me out here?

    Thank you for your time...
    Last edited by BShadow; Oct 8th, 2002 at 04:04 PM.
    "Experience is something you don't get until just after you need it."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width