Execute sql query

@param string $query Sql query

@return array|bool
5326
public function doQuery($query)
    {
        $this->statement = $this->db->query($query);
        if ($this->statement && $this->statement->rowCount()) {
            return $this->statement->rowCount();
        }
        return false;
    }
223388
public static function executeRow1(string $query): array
  {
    self::logQuery($query);

    return self::$dl->executeRow1($query);
  }
258693
public function execute( $query, $debug = 1 )
	{
		$result = false;
		if( $query )
		{
			if( $debug > 0 )
			{
				$bits = $this->getBits( $debug, 5 );
				if( $bits[0] )
				{
					$this->countQueries++;
					$start = $this->getMicroTime();
				}
				if( $bits[1] )
					echo $query;
				if( $bits[2] )
					remark( $query );
				if( $bits[3] )
					die();
			}
			if( preg_match( '/^INSERT/i', ltrim( $query ) ) )
			{
				if( $result = mssql_query( $query, $this->dbc ) )
				{
					$this->insertId = $result->last_insert_id;
					$result	= $this->insertId;
				}
			}
			else if( preg_match( '/^(SELECT|SHOW)/i', ltrim( $query ) ) )
			{
				$result = new DB_Result();
				if( $q = mssql_query( $query, $this->dbc ) )
				{
					while( $d = mssql_fetch_array( $q ) )
					{
						$row = new DB_Row();
						foreach( $d as $key => $value )
							$row->$key = $value;
						$result->rows[] = $row;
					}
				}
			}
			else
			{
				$result = mssql_query( $query, $this->dbc );
			}
			if( mssql_get_last_message() )
				$this->handleError( 0, mssql_get_last_message(), $query );
			if( $debug > 0 )
			{
				if( $bits[0] )
					$this->countTime += $this->getTimeDifference( $start );
				if( $bits[4] )
					die();
			}
			return $result;
		}
	}
1300204
public function execute($query, $parameters = [])
    {
        $statement = $this->link->prepare($query);
        $statement->execute($parameters);
        return $statement->rowCount();
    }
1277561
public function exec($query)
    {
        $stmt = $this->getWye()->makeStatement($query, []);

        $stmt->execute();

        return $stmt->rowCount() !== null ? $stmt->rowCount() : 0;
    }
954997
public function execute($query, $bindings = [])
    {
        if (strtolower(substr($query, 0, 6)) === "select" && $this->forcePrefix) {
            $query = $this->forcePrefix . $query;
        }

        return $this->run($query, $bindings, function ($query, $bindings) {
            if ($this->pretending()) {
                return true;
            }

            $statement = $this->getPdo()->prepare($query);

            $this->bindValues($statement, $bindings);

            $statement->execute();
            return $statement;
        });
    }
854350
protected function executeQuery($query)
    {
        $content = (string) $this->getAdapter()->get($query)->getBody();

        if (null === $content) {
            throw new NoResult(sprintf('Could not execute query %s', $query));
        }

        $data = (array) json_decode($content, true);

        if (empty($data) || false === $data) {
            throw new NoResult(sprintf('Could not execute query %s', $query));
        }

        if ('INVALID_KEY' === $data['status']) {
            throw new InvalidCredentials('API Key provided is not valid.');
        }

        return array(array_merge($this->getDefaults(), array(
            'latitude'     => isset($data['result']['location']['lat']) ? $data['result']['location']['lat'] : null,
            'longitude'    => isset($data['result']['location']['lng']) ? $data['result']['location']['lng'] : null,
            'streetNumber' => isset($data['result']['addressComponent']['street_number']) ? $data['result']['addressComponent']['street_number'] : null,
            'streetName'   => isset($data['result']['addressComponent']['street']) ? $data['result']['addressComponent']['street'] : null,
            'city'         => isset($data['result']['addressComponent']['city']) ? $data['result']['addressComponent']['city'] : null,
            'cityDistrict' => isset($data['result']['addressComponent']['district']) ? $data['result']['addressComponent']['district'] : null,
            'county'       => isset($data['result']['addressComponent']['province']) ? $data['result']['addressComponent']['province'] : null,
            'countyCode'   => isset($data['result']['cityCode']) ? $data['result']['cityCode'] : null,
        )));
    }
589397
public function execute($query) {
		$query = $query->compile();
		return $this->driver->query($query->sql(), $query->params());
	}
410207
public function fetch($query)
    {
        $result = $this->query($query);

        return $result->fetch(\PDO::FETCH_ASSOC);
    }
1184442
public function execute(string $query, array $params = []) : object
    {
        list($query, $params) = $this->expandParamArray($query, $params);

        if (!$this->pdo) {
            $this->createException("Did you forget to connect to the database?", $query, $params);
        }

        $this->stmt = $this->pdo->prepare($query);
        if (!$this->stmt) {
            $this->pdoException($query, $params);
        }

        if ($this->options["verbose"]) {
            echo $query . "\n";
            print_r($params);
        }

        $res = $this->stmt->execute($params);
        if (!$res) {
            $this->statementException($query, $params);
        }

        return $this;
    }
871678
protected function executeQuery($query)
    {
        $content = $this->getAdapter()->get($query)->getBody();

        if (null === $content) {
            throw new NoResult(sprintf('Could not execute query: %s', $query));
        }

        $json = json_decode($content, true);

        if (!empty($json['error']) && strtolower($json['error']) == 'invalid api key') {
            throw new InvalidCredentials('Invalid API Key');
        } elseif (!empty($json['error'])) {
            throw new NoResult(sprintf('Error returned from api: %s', $json['error']));
        }

        if (empty($json['results'])) {
            throw new NoResult(sprintf('Could not find results for given query: %s', $query));
        }

        $locations = $json['results'];

        $results = array();

        $ctr = 0;

        foreach ($locations as $location) {
            $ctr++;

            if ($ctr <= $this->getLimit()) {

                $coordinates = $location['location'];
                $address = $location['address_components'];

                //Geocodio does not always return a street, number, or suffix
                if (!isset($address['street']) && isset($json['input']['address_components']['street'])) {
                    //Sometimes Geocodio returns parsed information in the input
                    $addressInput = $json['input']['address_components'];
                    $address['street'] = $addressInput['street'];
                    $address['number'] = $addressInput['number'];
                    $address['suffix'] = $addressInput['suffix'];
                } elseif (!isset($address['street'])) {
                    $address['street'] = '';
                    $address['number'] = ''; // No Street = No Number
                    $address['suffix'] = '';
                }

                if (!empty($address['suffix'])) {
                    $address['street'] .= ' ' . $address['suffix'];
                }

                $results[] = array_merge($this->getDefaults(), array(

                        'latitude'      => $coordinates['lat'] ?: null,
                        'longitude'     => $coordinates['lng'] ?: null,
                        'streetNumber'  => $address['number'] ?: null,
                        'streetName'    => $address['street'] ?: null,
                        'city'          => $address['city'] ?: null,
                        'zipcode'       => $address['zip'] ?: null,
                        'county'        => $address['county'] ?: null,
                        'region'        => $address['state'] ?: null,
                        'country'       => 'US'
                    ));
            }
        }

        return $results;
    }
701852
public function executeSql($queries)
    {
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        if (is_array($queries) && !empty($queries)) {
            foreach ($queries as $query) {
                $query = trim($query);
                if (!empty($query)) {
                    $db->execute($query);
                }
            }
        }
    }
384015
public static function execInsert($query)
    {
        $ret = false;

        $res = self::query($query);

        if ($res) {
            $ret = self::connection()->sql_insert_id();
            self::free($res);
        }

        return $ret;
    }
1187544
public function executeQuery($query)
    {
        $results = $this->mysqliRef->query($query);
        if (!$results) {
            $mex = "Mysql error ".$this->mysqliRef->error." on '".$query."''";
            $this->log($mex);
            throw new MysqltcsException($mex);
        }else {
            $this->log($query);
            return $results;
        }
    }
1014270
public function statements($query, $statements)
    {
        try {
            $query = $this->conn->prepare($query);

            foreach ($statements as $key => $value) {
                $param = $statements[$key][0];
                $value = $statements[$key][1];
                $ifExists = (isset($statements[$key][2]));
                $dataType = $ifExists ? $statements[$key][2] : false;

                switch ($dataType) {
                    case 'bool':
                        $query->bindValue($param, $value, \PDO::PARAM_BOOL);
                        continue;
                    case 'null':
                        $query->bindValue($param, $value, \PDO::PARAM_NULL);
                        continue;
                    case 'int':
                        $query->bindValue($param, $value, \PDO::PARAM_INT);
                        continue;
                    case 'str':
                        $query->bindValue($param, $value, \PDO::PARAM_STR);
                        continue;
                }

                $query->bindValue($param, $value);
            }

            $query->execute();

            return $query;
        } catch (\PDOException $e) {
            $this->error = $e->getMessage();

            return null;
        }
    }
227068
protected function _execute($sql)
	{
		return $this->is_write_type($sql)
			? sqlite_exec($this->conn_id, $sql)
			: sqlite_query($this->conn_id, $sql);
	}
138216
function ExecuteQuery($query)
    {
        $this->lastQuery = $query;
        $result = mysqli_query($this->db, $query);
        $this->AssertSuccess();

        if ($result instanceof \mysqli_result)
            return new Reader($result);

        return null;
    }