Re: Problem Displaying Images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oh sorry. I use addslashes().


---------- Original Message -----------
From: Chris <dmagick@xxxxxxxxx>
To: Prathaban Mookiah <prathap@xxxxxxxxxxxx>
Cc: "php-general@xxxxxxxxxxxxx" <php-general@xxxxxxxxxxxxx>
Sent: Mon, 26 Jun 2006 07:14:42 +1000
Subject: Re:  Problem Displaying Images

> 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/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
------- End of Original Message -------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux