public function __construct(Database &$db, $result) { parent::__construct($db, $result); $this->_length = is_resource($this->_result) ? mysql_num_rows($this->_result) : 0; $this->resultOutput = self::RESULT_OBJECT; }
public function __construct(Database $db, $result) { parent::__construct($db, $result); if (!is_resource($this->_result)) { throw new DatabaseException("Not a valid MySQL Resource."); } $this->_length = (int) mysql_num_rows($this->_result); $this->resultOutput = self::RESULT_OBJECT; }