<?PHP
include_once "DB.php";
$dbh = DB::connect("odbc://db2inst1:passwd@sample");
if (DB::isError($dbh)) {
$str .= $dbh->getMessage();
}
$rsh = $dbh->getAll("SELECT * FROM STAFF", DB_FETCHMODE_ASSOC);
if (DB::isError($dbh)) {
$str .= $dbh->getMessage();
} else {
if (is_Array($rsh)) {
foreach($rsh as $data) {
$str .= "<TR>";
foreach($data as $val) {
$str .= "<TD>$val</TD>";
}
$str .= "</TR>";
}
$str = "<TABLE STYLE='font-family:tahoma;'>$str</TABLE>";
}
}
print $str;
?>
==========================================================
10 Sanders 20 Mgr 7 18357.50
20 Pernal 20 Sales 8 18171.25 612.45
30 Marenghi 38 Mgr 5 17506.75
40 O'Brien 38 Sales 6 18006.00 846.55
50 Hanes 15 Mgr 10 20659.80
60 Quigley 38 Sales 16808.30 650.25
70 Rothman 15 Sales 7 16502.83 1152.00
80 James 20 Clerk 13504.60 128.20
.......
|