RE: [PHP] Display an image
| From: | nate at savingadvice dot com | Date: | Sat, 13 Nov 2004 05:45:04 +0000 |
| Subject: | RE: [PHP] Display an image | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201890@lists.php.net to get a copy of this message | ||
You'll need to create a separate php page called image.php or something and
retrieve the $mydata2->photo and output it to the browser.
<img src='image.php?id=1'>
image.php
---
$sql = "select where id = '$id'";
echo $mydata2->photo;
Nate
-----Original Message-----
From: John Taylor-Johnston [mailto:taylorjo@collegesherbrooke.qc.ca]
Sent: Friday, November 12, 2004 9:29 PM
To: php-general@lists.php.net
Cc: John Taylor-Johnston
Subject: [PHP] Display an image
I have a longblob with a jpeg loaded in it. But how do I display it?
photo longblob NOT NULL,
This doesn't work :) I need header information, etc. So what does?
echo "<img src=".$mydata2->photo.">\n";
I don't have an example to work with.
John
----------snip-------------
$sql2 = "select * from ".$db.".".$table";
$news2 = mysql_query($sql2);
echo "<img src=".$mydata2->photo.">\n";
echo "<h3>$mydata2->Rank $mydata2->Name</h3>\n";
echo "<small><i>$mydata2->biography</i></small>\n";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php