You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
423 B

  1. <?php
  2. if(($conn = odbc_connect($dsn, $dbuser, $dbpwd))){
  3. if(($res = odbc_do($conn, "select gif from php_test where id='$id'"))){
  4. odbc_binmode($res, 0);
  5. odbc_longreadlen($res, 0);
  6. if(odbc_fetch_row($res)){
  7. header("content-type: image/gif");
  8. odbc_result($res, 1);
  9. exit;
  10. }else{
  11. echo "Error in odbc_fetch_row";
  12. }
  13. } else {
  14. echo "Error in odbc_do";
  15. }
  16. } else {
  17. echo "Error in odbc_connect";
  18. }
  19. ?>