在PostgreSQL中获取结果时,第一行总是丢失

时间:2014-10-27 10:54:01

标签: php postgresql

获取pg_num_rows = 1但无法获取行

$recordset = $obj_d->search_routing($this);
if(pg_num_rows($recordset)>0)
{
    if($row = pg_fetch_row($recordset))
    {
        $this->diallingprefix=$row[2];
        $this->forceroute=$row[5];
    }
}

1 个答案:

答案 0 :(得分:0)

使用 while( $row = pg_fetch_row($recordset) ) { }