반응형
<?php
$conn = OCILogon('user', 'secret', 'DB');
$th = 0; // Table Header
$query = 'select * from PAYMENT';
$stid = OCIParse($conn, $query);
OCIExecute($stid);
echo "<table>\n\n";
while (OCIFetchInto($stid, $row, OCI_ASSOC)) {
if (!$th) {
$keys = (array_keys($row));
echo "\n<tr>\n";
foreach ($keys as $k) {echo "<th>" . $k . "</th>\n";}
echo "</tr>\n";
$th = 1; // Table header done !
}
echo "\n<tr>\n";
foreach ($keys as $k) {echo "<td>" . $row[$k] . "</td>\n";}
echo "</tr>\n";
$count = $count + 1;
}
echo "</table>\n\n";
echo "<h3>" . $count . " records</h3>";
OCILogoff($conn);
?>
$conn = OCILogon('user', 'secret', 'DB');
$th = 0; // Table Header
$query = 'select * from PAYMENT';
$stid = OCIParse($conn, $query);
OCIExecute($stid);
echo "<table>\n\n";
while (OCIFetchInto($stid, $row, OCI_ASSOC)) {
if (!$th) {
$keys = (array_keys($row));
echo "\n<tr>\n";
foreach ($keys as $k) {echo "<th>" . $k . "</th>\n";}
echo "</tr>\n";
$th = 1; // Table header done !
}
echo "\n<tr>\n";
foreach ($keys as $k) {echo "<td>" . $row[$k] . "</td>\n";}
echo "</tr>\n";
$count = $count + 1;
}
echo "</table>\n\n";
echo "<h3>" . $count . " records</h3>";
OCILogoff($conn);
?>
반응형