You are here: image from MySQL database not working « PHP Programming Language « IT news, forums, messages
image from MySQL database not working

Posted by Jim Michaels on 04/16/06 00:03

<?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).

 

Navigation:

[Reply to this 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

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