Second fix for returning with multiple entries in DB IO

- all data stored in array (size contrain needs to be checked)
- allows any returning data
- only named rows are returned (no numbers for column access)
- if multiple rows then insert_id is an array with the return data
- if single row the insert_id holds the PK, and insert_id_ext holds
extended data if exists
This commit is contained in:
Clemens Schwaighofer
2017-03-14 15:19:31 +09:00
parent 6810c030e8
commit d64e40ca2c
3 changed files with 56 additions and 17 deletions

View File

@@ -152,12 +152,16 @@
}
// METHOD: _db_fetch_array
// PARAMS: cursor
// PARAMS: cursor, opt result type
// RETURN: row
// DESC : wrapper for pg_fetch_array
public function _db_fetch_array($cursor)
public function _db_fetch_array($cursor, $result_type = '')
{
return pg_fetch_array($cursor);
// result type is passed on as is [should be checked]
if ($result_type)
return pg_fetch_array($cursor, NULL, $result_type);
else
return pg_fetch_array($cursor);
}
// METHOD: _db_fetch_all