Re: Re: Displaying images
| From: | Shawn McKenzie | Date: | Wed, 27 May 2009 21:20:24 +0000 |
| Subject: | Re: Re: Displaying images | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293250@lists.php.net to get a copy of this message | ||
Miller, Terion wrote:
>
> Thanks for the suggestions everyone, I have this now, but still no image showing up
>
> It is stored as a blob in the database.
>
> on the output page I am calling it like this:
>
> <img src="image.php?filename=<?php echo $row['ePhoto'];
> ?>">
I was assuming that ePhoto was the actual binary data? If so then you
need something else here like id or something. I just used filename as
an example. If ePhoto is actually the filename then you are OK here,
but not below.
>
> Then on the image.php page I have this:
>
> <?php
> include("inc/dbconn_open.php");
> error_reporting(E_ALL);
>
> //image.php
> header("Content-type: img/jpeg");
> $filename = $_GET['filename'];
>
> $sql = "SELECT ePhoto from eagleProjects WHERE $filename= ePhoto";
Ummm... This can't work. What is ePhoto??? The data or the filename?
> $result=mysql_query($sql);
> $row = mysql_fetch_assoc ($result);
>
>
>
> ?>
>
> <?php echo $row['ePhoto']; ?>
>
> This page isn't working and if I try to browse this page it wants to open it with an
> editor, it won't view in the browser.
>
> What am I doing wrong? Is it the code or the data?
>
> Thanks
> Terion
--
Thanks!
-Shawn
http://www.spidean.com