Skip to content

Commit

Permalink
Deprecate colon prefix for prepared statement parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Nov 3, 2020
1 parent cad295a commit 02216c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Upgrade to 2.12

## Deprecated colon prefix for prepared statement parameters

The usage of the colon prefix when binding named parameters is deprecated.

$sql = 'SELECT * FROM users WHERE name = :name OR username = :username';
$stmt = $conn->prepare($sql);

// The usage of the colon is deprecated
$stmt->bindValue(':name', $name);

// Only the parameter name should be passed
$stmt->bindValue('username', $username);

$stmt->execute();

## PDO signature changes with php 8

In php 8.0, the method signatures of two PDO classes which are extended by DBAL have changed. This affects the following classes:
Expand Down

0 comments on commit 02216c5

Please sign in to comment.