You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've typically used mysql and oracle and never seen this issue until using postgres. I've narrowed it down to using getRow when there are no rows found. using getRows() when there are no rows does not produce the error, just getRow().
code samples below:
function test_record_direct() {
$dbconn = getNamedConnection();
echo "calling getRow<br/>";
$item = &$dbconn->GetRow('select * from doctor where doctor_id=13593999');
echo "finished calling getRow<br/>";
var_dump($item);
}
output:
calling getRow
(postgres8): select * from doctor where doctor_id=13593999
2016-05-13 16:31:43 -0500 /var/www/html/phpLiteFramework/thirdParty/dbAbstraction/adodb-5.20.4/drivers/adodb-postgres64.inc.php:1043 pg_fetch_array() [function.pg-fetch-array]: Unable to jump to row 0 on PostgreSQL result index 8
finished calling getRow
array(0) { }
However, using getRows does not give the postgres error
function test_records_direct() {
$dbconn = getNamedConnection();
$rs = &$dbconn->Execute('select * from doctor where doctor_id=13593999');
echo "calling getRows<br/>";
$items = &$rs->GetRows();
echo "finished calling getRows<br/>";
var_dump($items);
}
output:
(postgres8): select * from doctor where doctor_id=13593999
calling getRows
finished calling getRows
array(0) { }
The text was updated successfully, but these errors were encountered:
It would seem that postgres would throw that error if you were trying to retrieve a row from an empty recordset See Here. The ADOdb code does have a silencer on it, so the error should just be ignored. Is it possible that there are custom error-handling overrides in place that might be causing it?
getRows wouldn't return such an error because it would just convert the empty recordset into an empty array.
@mnewnham Thanks for looking at this... my apologies... yes, I do have a custom error handler, and I didn't realize it was presently configured to log everything to the output, including WARNING messages!
I've typically used mysql and oracle and never seen this issue until using postgres. I've narrowed it down to using getRow when there are no rows found. using getRows() when there are no rows does not produce the error, just getRow().
code samples below:
output:
However, using getRows does not give the postgres error
output:
The text was updated successfully, but these errors were encountered: