The following code works with Apache/1.3.27 (Unix) PHP/4.3.0 mod_ssl/2.8.12 OpenSSL/0.9.6b.
<?
$db_host="db@hostname";
$db_user="username";
$db_pass="userpassword";
$connection = ifx_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!");
ifx_textasvarchar(1);
$res_id = ifx_query("select length(statement) len, statement from statements where bfhist = " . $_REQUEST["bfhist"] . ";", $connection);
if ( ! $res_id ) {
printf("Can't select\n", ifx_error());
ifx_errormsg();
die;
}
$row = ifx_fetch_row($res_id, "CURRENT");
$len=$row['len'];
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Dispostion: inline;");
echo $row["statement"];
ifx_free_result($res_id);
?>
But with Apache2 the sql statement becomes corrupted and I get an error message that states I have a syntax error in my sql statement.
Could someone please show me the error of my ways? And I'm only speaking of the code.