I modified that code to make it more readable. You may be wondering why the $columns
variable looks like a string and then later like an array. Don't worry....there's no
bug there. The $query variable actually equals "select ${columns_imploded} from
${state}_spell where ${where_clauses}";
Matt
Matt Hillebrand <[EMAIL PROTECTED]> wrote:
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use
the ORA functions. The code below looks fine to me. It will return *almost* all of the
rows, but then the script just dies with no warnings or errors, even though I have
called error_reporting(E_ALL). I do get the following error message in an Apache error
log:
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function
OPARSE).
Here's my code:
<?
$query = "select $columns from $table where $where_clauses";
ora_parse($cursor, $query) or die("<br>ora_parse() failed: ".ora_error());
ora_exec($cursor) or die("<br>ora_exec() failed: ".ora_error());
print '<br><br><a name=results><table border=1>';
$rowcount = 0;
while(ora_fetch($cursor)) {
print '<tr>';
for($i=0; $i<sizeof($columns); $i++) {
$cell_data = ora_getcolumn($cursor, $i);
if($cell_data === false)
die("ora_getcolumn() failed: ".ora_error());
print "<td>$cell_data</td>";
}
print "</tr>\n";
}
print '</table>';
?>
Thanks for any advice.
Matt