Beispiel #1
0
 /**
  * 获取数据库中有多少条记录
  *
  * @param string $sql SQL语句
  * @return integer 数据记录数
  */
 private function _amount($sql)
 {
     if (stripos($sql, 'GROUP BY') !== false) {
         $this->_db->query($sql);
         $row_nu = $this->_db->num_rows();
     } else {
         $res = $this->_db->fetch_row($sql);
         $row_nu = $res['CNUM'];
     }
     $this->_db->free();
     $this->amount = $row_nu;
     return $this->amount;
 }