All,
I recently posted a question to the forum -- it was ill-formed. However, thanks for the feedback. Here's a more accurate description of my problem:
I'd like to alternate the bgcolor on returned rows (from Oracle). While this is fairly straightforward when using MySQL, I've not been able to do it using the OCI8 calls (can't use the "echo" structure). Here's the functionality that I'd like to include (which, obviously, must be rewritted) & my code. If you could provide an example, I'd be much obliged.
#################### Desired:
<?php
$rowCol1 = "#CCCCCC";
$rowCol2 ="#DDDDDD";
$col = $rowCol1
echo "<table>\n";
while (// something to loop through dataset) {
echo "<tr bgcolor=\"$col\">\n<td">\n Row Data Here </td>\n</tr>\n";
$col == $rowCol1 ? $col = $rowCol2 : $col = $rowCol1;
}
echo "</table>\n";
?>
----------------End Sample----
#################### My Code:
<?
require('./db-include.inc');
$iDBConn = OCILogon(DB_USER, DB_PASS, DB_NAME);
?>
<?php
$qsvGetTablespaceData = "
SELECT tablespace_name, file_name
FROM dba_data_files
ORDER BY tablespace_name, file_name ";
$iStatement = @OCIParse($iDBConn, $qsvGetTablespaceData);
@OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);
if ($arrError['code']) { print $arrError['message'];
exit;
}
?>
<table border="1" width="600">
<tr>
<td>tablespace_name</td>
<td>file_name</td>
</tr>
<?
while (OCIFetchInto($iStatement, &$arrEmployee, OCI_ASSOC+OCI_RETURN_NULLS))
{
?>
<tr>
<td><?= $arrEmployee['TABLESPACE_NAME'] ?></td>
<td><?= $arrEmployee['FILE_NAME'] ?></td>
</tr>
<? }?>
</table>
-------------End Sample--