Jump to content
abelhermar

Sybase select img from PHP sybase_query

Recommended Posts

I have a problem with visualize a image in web from Sybase.

$select  = "SELECT gImg FROM TIMG WHERE id=$id";

$rs = sybase_query($select  , $link_connection);

$row = sybase_fetch_assoc($rs);

$img = $row['gImg'];

header('Content-type: image/jpeg');

echo $img

- The format of image in database is wmf.

I don´t see the image in the web browser, I need some codification or function?

Thank´s.

PHP Version 5.3.5

 

 

Share this post


Link to post
Share on other sites
6 hours ago, Barand said:

How are you attempting to display the image in the browser?

I resolve this using a $img = hex2bin($row['gImg']); and display the image in browser: 

      header('Content-type: image/jpeg');            
      print_r($img);

Share this post


Link to post
Share on other sites

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.