Here, more or less, is all of the code in question. Maybe this will give you a better idea of what i'm talking about. Using $cursor_two and this sql statement: "SQL: select * from schedule," this is the error I get:
Warning: ORA-01003: no statement parsed -- while processing OCI function ODESCR in /w/profiles/admin/admin_ptp.php3 on line 98
Please let me know if there is anything else I can clarify. Thank you...
Josh.
##| THESE ARE THE CURSORS I AM USING
$cursor = ora_open($dbh) or
die("<font color=red><b>COULD NOT OPEN CURSOR</font>");
$cursor_two = ora_open($dbh) or
die("<font color=red><b>COULD NOT OPEN CURSOR_TWO</b></font>");
##| THIS IS THE CODE WHERE I AM USING BOTH CURSORS (I USE THEM BOTH ##| ELSEWHERE, BUT IN THAT OTHER PLACE I HAVE THE SAME PROBLEM
##| NOTE: THE FUNCTIONS I CALL ARE PASTED BELOW
QueryDatabase(RetrieveSchedule($SCHED_TABLE, "", ""), 2);
ora_fetch_into($cursor_two, &$schedule);
QueryDatabase(RetrieveOther("", $ENTRY_TABLE, "where scheduleid='DP'"), 1);
while(ora_fetch_into($cursor, &$dealer)) {
$image = $dealer[1] . ".gif";
fwrite($output, "<tr><td><img src='$image'></td>\n");
for($i=0; $i < $NUM_GAMES; $i++) {
$schedule_id = $dealer[2];
$pick = $i + 10;
if($dealer[pick] == 'H') { $team = 3 * $i + 4; }
else { $team = 3 * $i + 4; }
fwrite($output, "<td>$schedule[$team]</td>\n");
}
fwrite($output, "</tr>\n\n");
}
##| ----FUNCTIONS BELOW--------------------------------------------- |##
##| QueryDatabase - PARSES AND EXECUTES SQL ON GIVEN DB HANDLE
##| RECIEVES: SQL STATEMENT, NUMBER OF CURSOR TO USE
##| RETURNS: TRUE ON SUCCESS, FALSE OTHERWISE
function QueryDatabase($sql, $num) {
global $cursor, $cursor_two;
$cursor_num = "cursor";
if($num == 2) { $sql = "select * from schedule"; $cursor_num = "cursor_two"; }
$execute = ora_parse($$cursor_num, $sql);
if(ora_exec($execute)) { return 1; }
else { return 0; }
}
##| RetrieveOther - PREPARES SQL STATEMENT TO GET CONTENTS OF A TABLE
##| RECIEVES: COLUMNS TO SELECT, TABLE TO QUERY, CONDITIONS
##| RETURNS: READY-TO-USE SQL STATEMENT
function RetrieveOther($columns, $table, $conditions) {
$sql = "select $columns from $table $conditions";
return $sql;
}