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