Пример #1
0
 /**
  * This function sends a query to the database.
  *
  * @param string  $query
  * @param integer $offset
  * @param integer $rowcount
  *
  * @return PDOStatement $statement
  */
 public function query($query, $offset = 0, $rowcount = 0)
 {
     if (DEBUG) {
         $this->sqllog .= PMF_Utils::debug($query);
     }
     try {
         return $this->conn->query($query);
     } catch (PDOException $e) {
         $this->sqllog .= $e->getMessage();
     }
 }
Пример #2
0
 /**
  * This function sends a query to the database.
  *
  * @param string  $query
  * @param integer $offset
  * @param integer $rowcount
  *
  * @return  mixed $result
  */
 public function query($query, $offset = 0, $rowcount = 0)
 {
     if (DEBUG) {
         $this->sqllog .= PMF_Utils::debug($query);
     }
     if (0 < $rowcount) {
         $query .= sprintf(' LIMIT %d,%d', $offset, $rowcount);
     }
     $result = $this->conn->query($query);
     if (!$result) {
         $this->sqllog .= $this->error();
     }
     return $result;
 }
 /**
  * This function sends a query to the database.
  *
  * @param string  $query
  * @param integer $offset
  * @param integer $rowcount
  *
  * @return  mixed $result
  */
 public function query($query, $offset = 0, $rowcount = 0)
 {
     if (DEBUG) {
         $this->sqllog .= PMF_Utils::debug($query);
     }
     $result = mysql_query($query, $this->conn);
     if (!$result) {
         $this->sqllog .= $this->error();
     }
     return $result;
 }
Пример #4
0
 /**
  * This function sends a query to the database.
  *
  * @param string  $query
  * @param integer $offset
  * @param integer $rowcount
  *
  * @return  mixed $result
  */
 public function query($query, $offset = 0, $rowcount = 0)
 {
     if (DEBUG) {
         $this->sqllog .= PMF_Utils::debug($query);
     }
     if (0 < $rowcount) {
         $query .= sprintf(' OFFSET %d ROWS FETCH NEXT %d ROWS ONLY', $offset, $rowcount);
     }
     $result = mssql_query($query, $this->conn);
     if (!$result) {
         $this->sqllog .= $this->error();
     }
     return $result;
 }
 /**
  * This function sends a query to the database.
  *
  * @param string  $query
  * @param integer $offset
  * @param integer $rowcount
  *
  * @return  mixed $result
  */
 public function query($query, $offset = 0, $rowcount = 0)
 {
     if (DEBUG) {
         $this->sqllog .= PMF_Utils::debug($query);
     }
     $options = array('Scrollable' => SQLSRV_CURSOR_KEYSET);
     if (0 < $rowcount) {
         $query .= sprintf(' OFFSET %d ROWS FETCH NEXT %d ROWS ONLY', $offset, $rowcount);
     }
     $result = sqlsrv_query($this->conn, $query, array(), $options);
     if (!$result) {
         $this->sqllog .= $this->error();
     }
     return $result;
 }