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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.