本文整理汇总了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);
}