當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JDatabaseDriver::getNumRows方法代碼示例

本文整理匯總了PHP中JDatabaseDriver::getNumRows方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDatabaseDriver::getNumRows方法的具體用法?PHP JDatabaseDriver::getNumRows怎麽用?PHP JDatabaseDriver::getNumRows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JDatabaseDriver的用法示例。


在下文中一共展示了JDatabaseDriver::getNumRows方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: query

 /**
  * {@inheritdoc}
  */
 public function query($sql)
 {
     $sql = $this->_prepareSql($sql);
     $result = $this->_db->setQuery($sql)->execute();
     if (is_bool($result)) {
         return $result;
     }
     return $this->_db->getNumRows();
 }
開發者ID:JBZoo,項目名稱:CrossCMS,代碼行數:12,代碼來源:Database.php

示例2: _getListCount

 /**
  * Returns a record count for the query.
  *
  * @param   JDatabaseQuery|string  $query  The query.
  *
  * @return  integer  Number of rows for query.
  *
  * @since   12.2
  */
 protected function _getListCount($query)
 {
     // Use fast COUNT(*) on JDatabaseQuery objects if there is no GROUP BY or HAVING clause:
     if ($query instanceof JDatabaseQuery && $query->type == 'select' && $query->group === null && $query->union === null && $query->unionAll === null && $query->having === null) {
         $query = clone $query;
         $query->clear('select')->clear('order')->clear('limit')->clear('offset')->select('COUNT(*)');
         $this->_db->setQuery($query);
         return (int) $this->_db->loadResult();
     }
     // Otherwise fall back to inefficient way of counting all results.
     // Remove the limit and offset part if it's a JDatabaseQuery object
     if ($query instanceof JDatabaseQuery) {
         $query = clone $query;
         $query->clear('limit')->clear('offset');
     }
     $this->_db->setQuery($query);
     $this->_db->execute();
     return (int) $this->_db->getNumRows();
 }
開發者ID:deenison,項目名稱:joomla-cms,代碼行數:28,代碼來源:legacy.php

示例3: getNumRows

 /**
  * Returns the number of rows returned from the most recent query.
  *
  * @param  \mysqli_result|\resource  $cursor
  * @return int
  */
 public function getNumRows($cursor = null)
 {
     return $this->_db->getNumRows($cursor);
 }
開發者ID:bobozhangshao,項目名稱:HeartCare,代碼行數:10,代碼來源:CmsDatabaseDriver.php

示例4: getNumRows

 /**
  * Returns the number of rows returned from the most recent query.
  * 
  * @return int
  */
 function getNumRows($cur = null)
 {
     return $this->_db->getNumRows($cur);
 }
開發者ID:rogatnev-nikita,項目名稱:cloudinterpreter,代碼行數:9,代碼來源:cb.database.php


注:本文中的JDatabaseDriver::getNumRows方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。