#debug($opt);
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();
} else {
$this->db()->conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
-
}
$st = $this->db()->conn->prepare($sql);#,[PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT]);
}
$count = 0;
- while ($fct() and $row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
+ while ((empty($fct) or $fct()) and $row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
$count++;
$call = null;