{@inheritdoc}

This method supports PDO or DBAL type.
421547
public function bindValue($parameter, $value, $type = \PDO::PARAM_STR)
    {
        list($value, $type) = TypeUtility::convertToDatabase($value, $type, $this->connection->getPlatform());

        return $this->getDriverStatement()->bindValue($parameter, $value, $type);
    }
75886
public function getType()
    {
        $sql = $this->getSql();

        $type = strtok(strtolower(trim($sql)), ' ');
        $type = preg_replace ('/[^a-z]/i', '', $type);

        $allowedTypes = [
            self::QUERY_TYPE_SELECT,
            self::QUERY_TYPE_INSERT,
            self::QUERY_TYPE_UPDATE,
            self::QUERY_TYPE_DELETE,
            self::QUERY_TYPE_TRUNCATE,
        ];

        if (!in_array($type, $allowedTypes)) {
            throw new RuntimeException('Invalid query type');
        }

        return $type;
    }
1121821
public static function dbQuery($sql) {
        
        try {
            return self::query($sql);   
        } catch (PDOException $e) {
            die(self::dbError($sql));
        }
    }
952466
public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
	{
		if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
			$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;

		$this->_dataType = $pDataType;

		return $this->notifyCacheController();
	}
1000614
private function bindTypedParameters()
    {
        $streams = $values = [];
        $types   = $this->types;

        foreach ($this->_bindedValues as $parameter => $value) {
            if (! isset($types[$parameter - 1])) {
                $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING];
            }

            if ($types[$parameter - 1] === static::$_paramTypeMap[ParameterType::LARGE_OBJECT]) {
                if (is_resource($value)) {
                    if (get_resource_type($value) !== 'stream') {
                        throw new InvalidArgumentException('Resources passed with the LARGE_OBJECT parameter type must be stream resources.');
                    }
                    $streams[$parameter] = $value;
                    $values[$parameter]  = null;
                    continue;
                }

                $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING];
            }

            $values[$parameter] = $value;
        }

        if (! $this->_stmt->bind_param($types, ...$values)) {
            throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno);
        }

        $this->sendLongData($streams);
    }
23594
public function execute()
	{
		if( count( $this->_binds ) !== count( $this->_parts ) - 1 ) {
			throw new MW_DB_Exception( sprintf( 'Number of binds (%1$d) doesn\'t match the number of markers in "%2$s"', count( $this->_binds ), $this->_sql ) );
		}

		$sql = $this->_buildSQL();

		try {
			return new MW_DB_Result_PDO( $this->_conn->query( $sql ) );
		} catch ( PDOException $pe ) {
			throw new MW_DB_Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ) . $pe->getMessage(), $pe->getCode(), $pe->errorInfo );
		}
	}
26054
public function select($query, $bindings = [], $useReadPdo = true) {
    $types = [];

    $rows = $this->run($query, $bindings, function($query, $bindings) use($useReadPdo, &$types) {
      if($this->pretending()) {
        return [];
      }

      $statement = $this->getPdoForSelect($useReadPdo)->prepare($query);
      $statement->execute($this->prepareBindings($bindings));

      for($i = 0; $i < $statement->columnCount(); $i++) {
        $meta = $statement->getColumnMeta($i);

        if($meta !== false) {
          $type = $meta['native_type'];

          if(isset($meta['sqlite:decl_type'])) {
            if($meta['sqlite:decl_type'] === 'datetime') {
              $type = $meta['sqlite:decl_type'];
            }
          }

          $types[$meta['name']] = strtolower($type);
        }
      }

      return $statement->fetchAll(PDO::FETCH_ASSOC);
    });

    foreach($rows as &$row) {
      foreach($row as $col => &$value) {
        if($value !== null) {
          switch($types[$col]) {
            case 'long':
            case 'integer':
              $value = (int)$value;
            break;

            case 'double':
              $value = (float)$value;
            break;

            case 'timestamp':
            case 'datetime':
              if(strpos($value, '.') === false) {
                $value = strtotime($value);
              } else {
                $value = (float)DateTime::createFromFormat('Y-m-d H:i:s.u', $value)->format('U.u');
              }
            break;
          }
        }
      }
    }

    return $rows;
  }
71064
public function convertToDatabaseValueSQL($value, AbstractPlatform $platform)
    {
        if (null === $value || '' === $value) {
            $value = null;
        }

        return $this->getSqlType()->convertToDatabaseValueSQL($value, $platform);
    }
5576
public function execute($inputParams = [])
    {
        $bingID = $this->pdo->getBingId();
        $pool = $this->pdo->pool;
        if(!empty($inputParams)){
            $this->_boundColumns = $inputParams;
        }
        if(!empty($this->_boundColumns)){
            $this->prepareParamName();
            $this->_resultData = $pool->prepareAndExecute($this->statement,$this->_boundColumns,$bingID);
            $this->pdo->setLastInsertId($this->_resultData->insert_id);
        }else{
            $this->_resultData = $pool->doQuery($this->statement,$bingID);
        }
        if($this->_resultData->result === false){
            throw new PDOException($this->_resultData->error);
        }
        return true;
    }
62831
public static function dbQ2ArrayAll($sql, $atype = "assoc") {

        try {
            $res = self::query($sql);
            if (is_object($res)) {
                $type = self::getPDOFetchType($atype);
                return $res->fetchAll($type);
            }
        } catch (PDOException $e) {
            die(self::dbError($sql));
        }
    }
906163
public function query()
	{
		if ($this->query_sql === null) {
			$this->compile();
		}

		if (empty($this->query_params)) {
			$t = microtime(true);
			try {
				$result = $this->pdo->query($this->query_sql);
				if ($this->log_query) {
					error_log(sprintf("SQL Query time: %F ms (query), %d rows.", (microtime(true) - $t) * 1000, $result->rowCount()));
				}
			}
			catch (\PDOException $ex) {
				throw new FlupdoException($ex->getMessage(), $ex->getCode(), $ex, $this->query_sql, $this->query_params);
			}
			if (!$result) {
				throw new FlupdoException(vsprintf("SQLSTATE[%s]: Error %s: %s", $this->pdo->errorInfo()),
					$this->pdo->errorCode(), null, $this->query_sql, $this->query_params);
			}
			return $result;
		} else {
			$t = microtime(true);
			try {
				$stmt = $this->prepare();
			}
			catch (\PDOException $ex) {
				throw new FlupdoException($ex->getMessage(), $ex->getCode(), $ex, $this->query_sql, $this->query_params);
			}
			if ($stmt === FALSE) {
				throw new FlupdoException(vsprintf("SQLSTATE[%s]: Error %s: %s", $this->pdo->errorInfo()),
					$this->pdo->errorCode(), null, $this->query_sql, $this->query_params);
			}

			$i = 1;
			foreach ($this->query_params as $param) {
				if (is_bool($param)) {
					$stmt->bindValue($i, $param, \PDO::PARAM_BOOL);
				} else if (is_null($param)) {
					$stmt->bindValue($i, $param, \PDO::PARAM_NULL);
				} else if (is_int($param)) {
					$stmt->bindValue($i, $param, \PDO::PARAM_INT);
				} else {
					// ignore locales when converting to string
					$stmt->bindValue($i, strval($param), \PDO::PARAM_STR);
				}
				$i++;
			}

			try {
				$success = $stmt->execute();
			}
			catch (\PDOException $ex) {
				throw new FlupdoException($ex->getMessage(), $ex->getCode(), $ex, $this->query_sql, $this->query_params);
			}
			if ($success === FALSE) {
				throw new FlupdoException(vsprintf("SQLSTATE[%s]: Error %s: %s", $stmt->errorInfo()),
					$stmt->errorCode(), null, $this->query_sql, $this->query_params);
			}
			if ($this->log_query) {
				error_log(sprintf("SQL Query time: %F ms (prepare + execute), %d rows.", (microtime(true) - $t) * 1000, $stmt->rowCount()));
			}
			if ($this->can_explain && $this->log_explain) {
				$this->explain();
			}
			return $stmt;
		}
	}
1050059
function value($type,$val) {
		switch ($type) {
			case self::PARAM_FLOAT:
				if (!is_string($val))
					$val=str_replace(',','.',$val);
				return $val;
			case \PDO::PARAM_NULL:
				return NULL;
			case \PDO::PARAM_INT:
				return (int)$val;
			case \PDO::PARAM_BOOL:
				return (bool)$val;
			case \PDO::PARAM_STR:
				return (string)$val;
			case \PDO::PARAM_LOB:
				return (binary)$val;
		}
	}
1289652
static function PDO(\PDO $pdo):self{
    return new class($host, $port) implements \ArrayAccess{

      function __construct(string $host, int $port){

      }

      function offsetExists($uri){

      }

      function offsetGet($uri):\ArrayAccess{
        return new class($uri) extends \Exception implements \ArrayAccess{#{{{

        };#}}}
      }

      function offsetSet($uri, $value){

      }

      function offsetUnset($uri){

      }

    };
  }
332161
function bindAndExecute() {
		$conn = $this->connection;

		if ($conn === null) {
			throw new RuntimeException('bindAndExecute cannot be called on a QueryStatement without a connection.');
		}
		if ($conn instanceof DBMSSQL && $conn->getDriver() === 'dblib' && function_exists('mb_detect_encoding')) {
			return $conn->query($this->__toString());
		}
		if ($conn instanceof DBSQLite) {
			return $conn->query($this->__toString());
		}

		$string = self::embedIdentifiers($this->getString(), array_values($this->identifiers), $conn);

		$result = $conn->prepare($string);
		foreach ($this->getParams() as $key => $value) {
			$pdo_type = PDO::PARAM_STR;
			if (is_int($value)) {
				$pdo_type = PDO::PARAM_INT;
			} elseif (is_null($value)) {
				$pdo_type = PDO::PARAM_NULL;
			} elseif (is_bool($value)) {
				$value = $value ? 1 : 0;
				$pdo_type = PDO::PARAM_INT;
			}
			$result->bindValue($key + 1, $value, $pdo_type);
		}
		$result->execute();
		return $result;
	}
1373038
public function dbTypecastValue($value)
    {
        if ($value === null) {
            return null;
        }

        switch ($this->type) {
            case Schema::TYPE_BIT:
                return decbin($value);
            case Schema::TYPE_BINARY:
                return is_string($value) ? new PdoValue($value, \PDO::PARAM_LOB) : $value;
            case Schema::TYPE_TIMESTAMP:
            case Schema::TYPE_DATETIME:
                return \Yii::$app->formatter->asDatetime($value, 'yyyy-MM-dd HH:mm:ss');
            case Schema::TYPE_DATE:
                return \Yii::$app->formatter->asDate($value, 'yyyy-MM-dd');
            case Schema::TYPE_TIME:
                return \Yii::$app->formatter->asTime($value, 'HH:mm:ss');
            case Schema::TYPE_JSON:
                return new JsonExpression($value, $this->dbType);
            case Schema::TYPE_COMPOSITE:
                return new CompositeExpression($value, $this->dbType, $this);
        }

        return $this->typecast($value);
    }
97875
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
    {
        if ($platform instanceof MySqlPlatform) {
            return sprintf('PointFromText(%s)', $sqlExpr);
        } else {
            return parent::convertToDatabaseValueSQL($sqlExpr, $platform);
        }
    }
463971
@Override
   public DatabaseDataType toDatabaseDataType(final Database database) {
      final DatabaseDataType databaseDataType;
      if (database instanceof DerbyDatabase) {
         databaseDataType = new DatabaseDataType("VARCHAR(32672) FOR BIT DATA");
      } else if (database instanceof H2Database) {
         // User's wanting to use a BLOB can use modifySql.
         databaseDataType = new DatabaseDataType("BINARY");
      } else if (database instanceof OracleDatabase) {
         databaseDataType = new DatabaseDataType("SDO_GEOMETRY");
      } else if (database instanceof PostgresDatabase) {
         databaseDataType = new DatabaseDataType(getName(), getParameters());
      } else {
         databaseDataType = new DatabaseDataType("GEOMETRY");
      }
      return databaseDataType;
   }