Ruckusing_Adapter_Sqlite3_Base::query PHP Method

query() public method

public query ( string $query ) : array | boolean | integer
$query string
return array | boolean | integer
    public function query($query)
    {
        $this->logger->log($query);
        $query_type = $this->determine_query_type($query);
        $data = array();
        if ($query_type == SQL_SELECT || $query_type == SQL_SHOW) {
            $SqliteResult = $this->executeQuery($query);
            while ($row = $SqliteResult->fetchArray(SQLITE3_ASSOC)) {
                $data[] = $row;
            }
            return $data;
        } else {
            $this->executeQuery($query);
            if ($query_type == SQL_INSERT) {
                return $this->sqlite3->lastInsertRowID();
            }
            return true;
        }
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Execute a query
  *
  * @param string $sql the query to run
  *
  * @return boolean
  */
 public function query($sql)
 {
     return $this->_adapter->query($sql);
 }