コード例 #1
0
ファイル: result.php プロジェクト: nevermlnd/cv
	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
0
ファイル: result.php プロジェクト: nasumi/fuel
	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
0
ファイル: cached.php プロジェクト: nevermlnd/cv
	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
0
ファイル: Result.php プロジェクト: alekseyshavrak/3cx
 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
0
ファイル: cached.php プロジェクト: jimktrains/rccms
 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
0
ファイル: Cached.php プロジェクト: noikiy/kohana
 public function __construct(array $result, $sql, $as_object = NULL)
 {
     parent::__construct($result, $sql, $as_object);
     $this->_total_rows = count($result);
 }
コード例 #7
0
ファイル: Result.php プロジェクト: noikiy/kohana
 public function __construct($result, $sql, $as_object)
 {
     parent::__construct($result, $sql, $as_object);
     $this->_total_rows = mysql_num_rows($result);
 }