list($sql,$where,$limit,$select_count) = $this->rows_sql($opt);
$st = null;
$cursor = null;
+ $sql_orig = null;
$fct = function() { return true; };
if ($this->db()->type == 'pgsql') {
+ $sql_orig = $sql;
$this->db()->conn->beginTransaction();
$sql = "DECLARE table_rows CURSOR FOR $sql";
$cursor = $this->db()->conn->prepare($sql);
$this->count = $opt['count'] = $count;
$this->limit = $opt['limit'] = $limit;
- if ($opt['is_html'] or $format=='wp') {
+ if ($opt['is_html'] or $format=='wp' or !empty($cursor)) {
+ if (!empty($sql_orig)) $sql = $sql_orig;
//
// Tot
//