Return the named column from the current row.
// Get the "id" value $id = $result->get('id');
mixed Module_Database_Result::get( string $name [, mixed $default = null ] )
参数列表
参数 类型 描述 默认值 $name
string
Column to get $default
mixed
Default value if the column does not exist null
mixed
public function get($name, $default = null)
{
$row = $this->current();
if ( $this->_as_object )
{
if ( isset($row->$name) ) return $row->$name;
}
else
{
if ( isset($row[$name]) ) return $row[$name];
}
return $default;
}