예제 #1
0
파일: DaoAdapter.php 프로젝트: zhxia/nspf
 public function select($table, $where = '', $order = '', $limit = 20, $offset = 0, $fields = '*')
 {
     $sql = SqlBuilder::buildQuerySql($table, $where, $order, $limit, $offset, $fields);
     $params = null;
     if (is_array($where)) {
         $params = array_values($where);
     }
     $stmt = $this->_dao->prepare($sql);
     if ($stmt->execute($params)) {
         return $stmt->fetchAll();
     }
     return false;
 }
예제 #2
0
파일: DaoAdapter.php 프로젝트: zhxia/nspf
 public function select($table, $where = '', $order = '', $limit = 20, $offset = 0, $fields = '*')
 {
     $sql = SqlBuilder::buildQuerySql($table, $where, $order, $limit, $offset, $fields);
     $stmt = $this->_dao->prepare($sql);
     $params = $this->buildParams($where);
     $this->bindParams($stmt, $params);
     if ($stmt->execute()) {
         $result = $stmt->get_result();
         if ($result) {
             return $result->fetch_all($this->_fetchModel);
         }
     }
     return false;
 }