I am trying to write a page in php with the goal of counting the specified data from the database and showing that data. It seems like a simple enough task, but I cannot get this to work correctly and I'm at the limits of my very limited PHP/SQL knowledge. This is my code for the whole page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Counter Test</title>
</head>
<body>
<div id="counter">
<?php
$advance = "(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xx.xx.xxx)(PORT = 1521)))
(CONNECT_DATA =
(SERVICE_NAME = domain.domain)))";
$conn = oci_connect('xxx', 'xxx', xxx);
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$stid = oci_parse($conn, 'SELECT count(distinct(b.id_number)) as total FROM bio b WHERE (b.alum_memb_type) is not null AND b.record_status_code NOT IN ('D', 'X', 'R')' );
oci_execute($stid);
echo "<table border='1'>\n";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
?>
</div>
</body>
</html>