Reply to Re: image from MySQL database not working

Your name:

Reply:


Posted by Jerry Stuckle on 04/16/06 05:55

Jim Michaels wrote:
> <?php
> include 'dbinc.php';
> $result = mysql_query("SELECT image,mime_type FROM photos WHERE
> image_id=".intval($_GET['id']), $link) or die("MyErr:".mysql_error());
> if ($row = mysql_fetch_assoc($result)) {
> $ext=array('image/jpeg'=>'jpg','image/gif'=>'gif','image/png'=>'png','image/x-png'=>'png');
> header("Expires: Mon, 26 Jul 2030 05:00:00 GMT");
> header("Content-Type: $row[mime_type]");
> header("Content-Disposition: inline;
> $_GET[id].".$ext[$row['mime_type']]);
> echo "\r\n".stripslashes($row['image']);
> }
> mysql_free_result($result);
> ?>
>
>
>
> what am I doing wrong? I don't get an image. I've seen thumbnail stuff. I
> don't want a thumbnail (that code didn't work either for some reason).
>
>

I have no idea what you did wrong. What do you get? What's in the source?
What's in the database row?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация