Jump to content

VIewing images in a MYsql DB


seran128

Recommended Posts

I am storing images in mysql (don't ask its a client request) I can see the images in Navicat as images but when I go to get it out with a select statement I get garbage.

my code

[code]function getpicturecontent($inId){
global $connection;
$sql="select * from images where ItemId='$inId'";
echo $sql;
$result=mysql_query($sql,$connection) or die(mysql_error());
while($row=mysql_fetch_array($result)) {
$getpicturecontent .= "<table width='200' border='0'>
    <tr>
      <td>" . $row['content'] . "</td>
    </tr>
    <tr>
      <td></td>
    </tr>
  </table>";
}
return $getpicturecontent;
} [/code]


This returns a bunch of characters. I know there is a header call I have to do but I cant find it.
Link to comment
https://forums.phpfreaks.com/topic/28316-viewing-images-in-a-mysql-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.