Please help with PHP Tables
Please help - I am trying to set up tables using PHP and Oracle. I want the data from Oracle to go into table form using PHP. I have the following code that does return some table headings such as USERID, USERNAME etc. The data from Oracle does not go into the tables though. How do I get the data from Oracle into the table in PHP?
<?php
echo "<pre>";
$db = "*********";
$c1 = oci_connect("somename", "name", $db);
function commit($conn)
{
oci_commit($conn);
echo $conn . " committed\n\n";
}
function select_data($conn)
{
$stmt = oci_parse($conn, "select * from anyname.users");
oci_execute($stmt, OCI_DEFAULT);
echo $conn."----selecting\n\n";
while (oci_fetch($stmt)) {
echo "<table border='3' table width='100%'bordercolor='gray'>";
echo "<tr>
<td align='center'>USERID</td>)
<td align='center'>USERNAME</td>
<td align='center'>USERPASS</td>
<td align='center'>USERMAIL</td>
</tr>";//create row and cells
echo " [" . oci_result($stmt, "USERID") . "] ";
echo " [" . oci_result($stmt, "USERNAME") . "] ";
echo " [" . oci_result($stmt, "USERPASS") . "] ";
echo " [" . oci_result($stmt, "USERMAIL") . "]\n\n";
}
echo $conn . "----done\n\n";
}
select_data($c1); // Results of both inserts are returned
commit($c1); // Commit using c1
echo"</table>";//close table
echo "</pre>";
?>
I am new to PHP but already have pulled significant amounts of hair out trying to get this to work. Any advice would be much appreciated.
Thanks