Well, I have broken down the script and utilizing actions as the pointers, running a query and then displaying the results in table format. The retrieve action works correctly, querying the data base by the inputted date from the queryform.html.
Several columns and rows are produced when activated: PON DTSENT PROVISIONER PROVNAME
The issue is when the output is produced in table format, how do I create only on the first column of the table for each record id found a url link and pass the record id (in this case 'PON') number found? Only PON should have a link to re-query the database, and then return all information about this PON only in table format as well.
Example 1: (Retrieve Query)
Date: 06-JUN-03
PON DTSENT PROVISIONER PROVNAME
0000002270551002 06-JUN-03 mspriss Miss Priss
A table (similar to above) would be displayed with the url of 0000002270551002 available to be selected for information data retrieval.
Example 2: (PON Query)
Would return all information found in the database for the PON number only, no matter how old the records were and display them in table format.
<?php
putenv("ORACLE_SID=test");
$username = "test";
$passwd = "test";
$db="(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA = (SID = test))
)";
$conn = OCILogon($username,$passwd,$db);
if (!$conn) {
echo "Connection failed";
echo "Error Message: [" . OCIError($conn) . "]";
exit;
}
else
{
echo "Connected to Database!\n\n";
}
$action = $_REQUEST['action'];
if ($action == '') { $action = "retrieve"; }
if ($action == 'retrieve') {
$date = $_POST['date'];
$stmt = OCIParse($conn, "select * from ASR_REPORT_EXTRACT where DTSENT = '$date'");
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
print "<TABLE BORDER=\"1\">\n";
print "<TR>\n";
while ( list( $key, $val ) = each( $results ) ) {
print "<TH>$key</TH>\n";
}
print "</TR>\n";
for ( $i = 0; $i < $nrows; $i++ ) {
reset($results);
print "<TR>\n";
while ( $column = each($results) ) {
$data = $column['value'];
print "<TD>$data[$i]</TD>\n";
}
print "</TR>\n";
}
print "</TABLE>\n";
} else {
echo "No data found<BR>\n";
}
print "$nrows Records Selected<BR>\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
}
// Query Database for PON Number information & return all results
if ($action == 'pon') {
$ponid = $_POST['ponid'];
$stmt = OCIParse($conn, "select * from ASR_REPORT_EXTRACT where PON = '$ponid'");
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
print "<TABLE BORDER=\"1\">\n";
print "<TR>\n";
while ( list( $key, $val ) = each( $results ) ) {
print "<TH>$key</TH>\n";
}
print "</TR>\n";
for ( $i = 0; $i < $nrows; $i++ ) {
reset($results);
print "<TR>\n";
while ( $column = each($results) ) {
$data = $column['value'];
print "<TD>$data[$i]</TD>\n";
}
print "</TR>\n";
}
print "</TABLE>\n";
} else {
echo "No data found<BR>\n";
}
print "$nrows Records Selected<BR>\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
}
?>