Re: Problem Displaying Images

From: Date: Sun, 25 Jun 2006 21:14:42 +0000
Subject: Re: Problem Displaying Images
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-238597@lists.php.net to get a copy of this message
Prathaban Mookiah wrote:
I am trying to manage images with a web database application. It works fine with MySQL 5.0.17 and PHP 5.1.1. But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.2, I have problems viewing the images retrieved from the database in the browser. The relevant part of the code is: $Result = mysql_fetch_array($Resource); if (!empty($Result["data"])) { header("Content-Type: {$Result['mime']}"); echo $Result["data"]; } But I see that some binary data is being echoed on to the client. But I guess it is corrupted in some way such that the browser cannot display it as an image. In fact I tried to save it as an image file, and the image viewer reported it as invalid format.
How are you putting it into the database? Are you using mysql_real_escape_string or mysql_escape_string, or are you using addslashes or something else? -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#238597) next »