本文整理匯總了PHP中Database_Result::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Database_Result::__construct方法的具體用法?PHP Database_Result::__construct怎麽用?PHP Database_Result::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Database_Result
的用法示例。
在下文中一共展示了Database_Result::__construct方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($result, $sql, $as_object = FALSE, array $params = NULL)
{
parent::__construct($result, $sql, $as_object, $params);
// Find the number of rows in the result
$this->_total_rows = mysql_num_rows($result);
}
示例2: __construct
public function __construct($result, $sql, $as_object)
{
parent::__construct($result, $sql, $as_object);
// Find the number of rows in the result
$this->_total_rows = mysql_num_rows($result);
}
示例3: __construct
public function __construct(array $result, $sql, $as_object = NULL)
{
parent::__construct($result, $sql, $as_object);
// Find the number of rows in the result
$this->_total_rows = count($result);
}
示例4: __construct
public function __construct($result, $sql, $as_object = FALSE, $params = NULL, $total_rows = NULL)
{
parent::__construct($result, $sql, $as_object, $params);
if ($as_object === TRUE) {
$this->_as_object = 'stdClass';
}
if ($total_rows !== NULL) {
$this->_total_rows = $total_rows;
} else {
switch (pg_result_status($result)) {
case PGSQL_TUPLES_OK:
$this->_total_rows = pg_num_rows($result);
break;
case PGSQL_COMMAND_OK:
$this->_total_rows = pg_affected_rows($result);
break;
case PGSQL_BAD_RESPONSE:
case PGSQL_NONFATAL_ERROR:
case PGSQL_FATAL_ERROR:
throw new Database_Exception(':error [ :query ]', array(':error' => pg_result_error($result), ':query' => $sql));
case PGSQL_COPY_OUT:
case PGSQL_COPY_IN:
throw new Database_Exception('PostgreSQL COPY operations not supported [ :query ]', array(':query' => $sql));
default:
$this->_total_rows = 0;
}
}
}
示例5: __construct
public function __construct(array $result, $sql, $as_object = NULL)
{
if (count($result) > 0) {
// Determine if we stored as objects or associative arrays
$as_object = get_class($result[0]);
}
// If there are no results, we don't care how they're returned
parent::__construct($result, $sql, $as_object);
// Find the number of rows in the result
$this->_total_rows = count($result);
}
示例6: __construct
public function __construct(array $result, $sql, $as_object = NULL)
{
parent::__construct($result, $sql, $as_object);
$this->_total_rows = count($result);
}
示例7: __construct
public function __construct($result, $sql, $as_object)
{
parent::__construct($result, $sql, $as_object);
$this->_total_rows = mysql_num_rows($result);
}