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;
	}
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;
	}
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 ; }
Creates a PDOStatment using the string. Loops through param array, and binds each value.
Executes and returns the prepared statement.
@return PDOStatement
Creates a PDOStatment using the string . Loops through param array and binds each value . Executes and returns the prepared statement .