You are here

public static function Utils::bindArguments in Drupal driver for SQL Server and SQL Azure 4.0.x

Same name and namespace in other branches
  1. 4.2.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::bindArguments()
  2. 3.1.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::bindArguments()
  3. 4.1.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::bindArguments()

Bind the arguments to the statement.

Parameters

\PDOStatement $stmt: Statement.

array $values: Argument values.

2 calls to Utils::bindArguments()
Insert::execute in src/Driver/Database/sqlsrv/Insert.php
Runs the query against the database.
Update::execute in src/Driver/Database/sqlsrv/Update.php
Executes the UPDATE query.

File

src/Driver/Database/sqlsrv/Utils.php, line 20

Class

Utils
Utility function for the SQL Server driver.

Namespace

Drupal\sqlsrv\Driver\Database\sqlsrv

Code

public static function bindArguments(\PDOStatement $stmt, array &$values) {
  foreach ($values as $key => &$value) {
    $stmt
      ->bindParam($key, $value, \PDO::PARAM_STR);
  }
}