Skip to content

Commit 2212384

Browse files
committed
fixing bug for get fields description
1 parent 6ada61d commit 2212384

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Database/drivers/pgsql.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,9 @@ public function raw_find($table, $condition=array(), $limit=array(), $order_by=a
313313
$query = QueryHelper::find($table, $condition, $limit, $order_by);
314314
if ($this->_raw_res = $this->exec($query)){
315315
$this->_fields = '';
316-
$nfields = pg_field_num($this->_raw_res);
316+
$nfields = pg_num_fields($this->_raw_res);
317317
$fields = array();
318318
for ($i=0; $i<$nfields; $i++) {
319-
$field = $this->_raw_res->getColumnMeta($i);
320319
$fields[] = (object) array(
321320
'name' => pg_field_name($this->_raw_res , $i),
322321
'type' => pg_field_type($this->_raw_res , $i),
@@ -400,10 +399,9 @@ public function fields($table) {
400399
if (empty($this->_fields)) {
401400
$query = QueryHelper::find($this->dbcon, $table, array(), array(1), array());
402401
if ($res = $this->exec($query)) {
403-
$nfields = pg_field_num($res);
402+
$nfields = pg_num_fields($res);
404403
$fields = array();
405404
for ($i=0; $i<$nfields; $i++) {
406-
$field = $res->getColumnMeta($i);
407405
$fields[] = (object) array(
408406
'name' => pg_field_name($res , $i),
409407
'type' => pg_field_type($res , $i),

0 commit comments

Comments
 (0)