<?php
$conn = oci_connect("username", "password", "dbname"); //连接oracle数据库
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}
$query = 'SELECT * FROM BS order by sj desc'; // 查询语句
$stid = oci_parse($conn, $query);
$r = oci_execute($stid);
// Fetch the results in an associative array
print '<table border="1">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?htmlentities($item):' ').'</td>';
}
print '</tr>';
}
print '</table>';
// Close the Oracle connection
oci_close($conn);
?>
$conn = oci_connect("username", "password", "dbname"); //连接oracle数据库
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}
$query = 'SELECT * FROM BS order by sj desc'; // 查询语句
$stid = oci_parse($conn, $query);
$r = oci_execute($stid);
// Fetch the results in an associative array
print '<table border="1">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?htmlentities($item):' ').'</td>';
}
print '</tr>';
}
print '</table>';
// Close the Oracle connection
oci_close($conn);
?>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/220205/viewspace-2145330/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/220205/viewspace-2145330/