Re: help - outputting a jpeg

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

 



On Tue, 29 Aug 2006 09:52:20 +0100, Ross wrote:

> I just get all the binary data output
> 
> <?
> include("includes/config.php");
> $link = mysql_connect($host, $user, $password) or die ('somethng went 
> wrong:' .mysql_error() );
>   mysql_select_db($dbname, $link) or die ('somethng went wrong, DB error:' 
> .mysql_error() );
> 
> $query = "SELECT DISTINCT gallery FROM thumbnails";
> $result = @mysql_query( $query,$link );
> 
> while ($row = @mysql_fetch_assoc($result) ) {
> 
> $gallery_id=$row['gallery'];
> 
> $query2 = "SELECT * FROM thumbnails WHERE gallery ='$gallery_id' LIMIT 1";
> $result2 = @mysql_query($query2);
> 
> while  ($row2 = @mysql_fetch_array($result2, MYSQL_ASSOC)){
> Header( "Content-type: image/pjpeg");
> echo "<img src=\"".$row2["bin_data"]."\">";
> 
> 
> }

You're mixing binary data with HTML. What do you want to do? If you want
to put multiple pictures on one page, first build the HTML, that loads the
pictures and use a php file to retrieve the given ID from the database and
output the header and binary result.

-- 
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