Demo 6 - Select rows
Output to an HTML table
Informix error: %s", ifx_errormsg());
die;
}
}
$database = "video";
$server = "lapdog_tcp";
$login = "username";
$password = "password";
$dbs = $database . "@" . $server;
$connect_id = ifx_pconnect($dbs,$login,$password);
if (!$connect_id) {
echo "Unable to connect to Informix database
\n";
chk_ifx_err1($connect_id);
} else {
echo "Informix connection successful!
";
}
if ($connect_id) {
$statmt_txt = "select first 5 tape_num Tape_number, title from vhs where type_code = 'ST1' order by title";
$statmt_id = ifx_prepare($statmt_txt,$connect_id,IFX_SCROLL); // PREPARE SELECT
if (!$statmt_id) { chk_ifx_err1($statmt_id); }
$ret_val = ifx_do($statmt_id); // EXECUTE PREPARED STATEMENT
if (!$ret_val) { chk_ifx_err1($statmt_id); }
ifx_htmltbl_result ($statmt_id, "BORDER='1' CELLSPACING=0 CELLPADDING=2 BGCOLOR='cornsilk' ");
}
?>