Sets the total number of rows and stores the result locally.
void Module_Database_Result::__construct( mixed $result , string $sql , $as_object , $config )
参数列表
参数 类型 描述 默认值 $result
mixed
Query result $sql
string
SQL query $as_object
unknown
$config
unknown
void
public function __construct( $result, $sql, $as_object ,$config )
{
// Store the result locally
$this->_result = $result;
// Store the SQL locally
$this->_query = $sql;
$this->_config = $config;
if ( is_object($as_object) )
{
// Get the object class name
$as_object = get_class($as_object);
}
// Results as objects or associative arrays
$this->_as_object = $as_object;
if ( isset($this->_config['auto_change_charset']) && $this->_config['auto_change_charset'] && $this->_config['charset'] !='UTF8' )
{
$this->_charset_need_change = true;
}
else
{
$this->_charset_need_change = false;
}
}