Subject Nested query using PEAR return error 504
Author Almond
Hello all.

I used a nested query like this:

$DB_Query = $DB_Connect->Query($Q);
while ($ROW = $DB_Query->fetchRow(DB_FETCHMODE_ASSOC)) {
$staff_pid = $ROW['TEMP_PAY_STAFF_PID'];
echo "Gen pay_cal $staff_pid <br>";
for ($i=1 ; $i<= $no_of_days ; $i++) {
$temp_date = $period_start + $i - 1;
$temp_week_day = JDDayOfWeek($temp_date, 2) ;
$temp_date = jdtounix($temp_date);
$temp_date = date("m/d/y",$temp_date);
$SQL = 'INSERT INTO pay_cal (pay_cal_staff_pid, pay_cal_date,
$SQL .= "VALUES ('$staff_pid', '$temp_date', ";
$SQL .= "'$temp_week_day'); ";
$SQL .= $nl;
$Insert_Query = $DB_Connect->Query($SQL);

When the "for" loop end and the control return to the "while" loop, I got
an error:

"Dynamic SQL Error SQL error code = -504 Cursor unknown".

I have changed the second query using "prepare" and "execute" but with no
luck. I do a search on news group, it looks like it is an ibase() error.
Anybody know how to solve this.

I'm using php 4.3.4.

Best regards,

Almond Wong