@param string $query
@param array $params

@return string
974874
public static function dump(string $query, array $params = [])
	{
		[$query, $params] = Doctrine\DBAL\SQLParserUtils::expandListParameters($query, $params, []);

		$parts = explode('?', $query);

		$output = [];
		while ($parts && $params) {
			$output[] = array_shift($parts);
			$output[] = self::formatParameter(array_shift($params));
		}

		return self::highlightQuery(implode('', array_merge($output, $parts ? : [], $params ? : [])));
	}
63055
protected function manage(array $params, array $query)
    {
        $params = array_merge($params, [
            'appid' => $this->app['config']->app_id,
            'nonce_str' => '',
            'sub_mch_id' => '',
            'sub_appid' => '',
        ]);

        return $this->safeRequest('secapi/mch/submchmanage', $params, 'post', compact('query'));
    }
333611
protected function _insert($query, $params)
    {
        $db = $this->db;
        $sth = $db->prepare($query);

        foreach ($params as $key => $val) {
            if (is_int($val)) {
                $sth->bindValue("$key", $val, $db::PARAM_INT);
            } else {
                $sth->bindValue("$key", $val);
            }
        }

        $response = $sth->execute();

        if ($response) {

            $class = $this->_rowClass;
            $row = new $class($this, $db->lastInsertId());

            return $row;
        }
        return false;
    }
1104138
public function all(string $query, array $params = [], ...$fetchMode): array
	{
		$prepared = $this->prepare($query, $params);

		$this->execute($prepared);

		return $prepared['statement']->fetchAll(...$fetchMode);
	}
635431
public function queryAndCount(string $query, array $params = []): int
	{
		$prepared = $this->prepare($query, $params);

		$this->execute($prepared);

		return $prepared['statement']->rowCount();
	}
909685
private function escapeSemicolon($query, $params) {

		preg_match_all('#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#', $query, $variables);

		if(true === isset($variables[0])) {

			foreach($variables[0] as $index => $variable) {
				
				if(false === array_key_exists($variables[1][$index], $params)) {
					return trigger_error(sprintf('Parameter "%s" missing from parameters', $params[1][$index]), E_USER_ERROR);
				}

				$var = $params[$variables[1][$index]];
					
				switch(gettype($var)) {

					case 'string' : $var = '"' . $this -> escape($var) . '"'; break;
					case 'NULL' : $var = 'NULL'; break;
					default : $var = $this -> escape($var); break;
				}

				$query = str_replace($variables[0][$index], $var, $query);
			}
		}

		return $query;
	}
1120140
protected function query($query, ...$params)
    {
        $saveParams = array_map([$this, 'quote'], $params);

        $baseSql = str_replace('{table}', $this->table, $query);
        $sql = vsprintf($baseSql, $saveParams);

        $ret = $this->server->query($sql);

        if ($ret === false) {
            trigger_error($this->server->error . " $sql", E_USER_NOTICE);
        }

        return $ret;
    }
261708
public function get_all($query, $params = []) {
		$statement = $this->get_statement($query, $params);
		$statement->execute();
		return $statement->fetch_assoc();
	}
1274378
public function query($query, $params = array())
  {
    $results = $this->api->get($query, $params);
    if(!isset($results->errors)) {
      return $results;
    } else {
      return $this->debug_mode ? $results->errors[0]->message : null;
    }
  }
931183
public function query($query, $params = array())
  {
    $curl = new Curl();
    $params['oauth2_access_token'] = $this->access_token;
    $params['format'] = 'json';
    $result = json_decode($curl->call(self::LINKEDIN_API_URL . trim($query, '/') . '?' . http_build_query($params), array(), 'GET', true), true);
    if(isset($result['errorCode'])) {
      return $this->debug_mode ? $result['message'] : null;
    }
    return $result['values'];
  }
1267916
private function prepareStatement($query, $parameters) {
            $stmt = $this->db_connection->prepare($query);

            if (!empty($parameters)) {
                foreach ($parameters as $key => $val) {
                    $stmt->bindValue($key, $val);
                }
            }

            return $stmt;
        }
1035981
public function column($query = '', $params = null)
    {
        $query = trim($query);
        if (empty($query)) {
            $query = $this->build();
            if (!$params) {
                $params = $this->getBindValues();
            }
        }

        $this->resetAll();
        $this->lastSql = $query;

        $this->execute($query, $params);
        $columns = $this->sQuery->fetchAll(PDO::FETCH_NUM);
        $column  = null;
        foreach ($columns as $cells) {
            $column[] = $cells[0];
        }
        return $column;
    }
349281
public function select($query, array $params = [], $fetchMode = null)
    {
        // Execute query
        $stmt = $this->connection->prepare($query);
        $stmt->execute($params);
        if ($fetchMode !== null) {
            $stmt->setFetchMode($fetchMode);
        }
        return $stmt->fetchAll();
    }
244109
public function result(string $query, array $params = [])
    {
        // Prepares the query, then stores it
        $PDOStatement = $this->pdo->prepare($query);

        // Executes the prepared query
        $PDOStatement->execute($params);

        // Fetchs the result, then returns it
        return $PDOStatement->fetch();
    }
364378
protected function prepare(string $query, array $params): array
    {
        try {
            $statement = $this->getPDO()->prepare($query);
        } catch (PDOException $e) {
            throw new PDOException($e->getMessage() . ' [ ' . $this->replaceParams($query, $params) . ' ] ',
                (int)$e->getCode(), $e->getPrevious());
        }

        return ['query' => $query, 'params' => $params, 'statement' => $statement];
    }
785423
public function replaceQueryParameters(string $query, $parameters): string
    {
        $values = $parameters;

        if ($parameters instanceof Data) {
            $values = $parameters->getValue(true);
        }

        $i = 0;

        if (!array_key_exists(0, $values) && array_key_exists(1, $values)) {
            $i = 1;
        }

        return preg_replace_callback(
            '/\?|((?<!:):[a-z0-9_]+)/i',
            static function ($matches) use ($values, &$i) {
                $key = substr($matches[0], 1);
                if (!array_key_exists($i, $values) && (!$key || !array_key_exists($key, $values))) {
                    return $matches[0];
                }

                $value = array_key_exists($i, $values) ? $values[$i] : $values[$key];
                $result = DoctrineExtension::escapeFunction($value);
                ++$i;

                return $result;
            },
            $query
        );
    }
343621
public static function getSqlWithParams(string $sql, array $params = []): string
    {
        if (! empty($params)) {
            $indexed = ($params === array_values($params));
            foreach ($params as $k => $v) {
                if (is_string($v)) {
                    $v = "'${v}'";
                }
                if (is_array($v)) {
                    $v = "'" . implode("','", $v) . "'";
                }
                if ($indexed) {
                    $sql = preg_replace('/\?/', $v, $sql, 1);
                } else {
                    $sql = str_replace(":${k}", $v, $sql);
                }
            }
        }

        return str_replace(PHP_EOL, '', $sql);
    }