-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Named placeholders only need to be contained in one of the union quer…
…ies (#625)
- Loading branch information
Showing
3 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace NamedPlaceholderBug; | ||
|
||
|
||
use PDO; | ||
|
||
class Foo | ||
{ | ||
public function errors(PDO $pdo, $vkFrom) | ||
{ | ||
$fromCondition = ''; | ||
if ('0' !== $vkFrom) { | ||
$fromCondition = 'and email = :vkFrom'; | ||
} | ||
|
||
$stmt = $pdo->prepare('SELECT email, adaid FROM ada WHERE adaid = :adaid ' . $fromCondition); | ||
$stmt->execute([ | ||
'adaid' => 1, | ||
'vkFrom' => 'hello world' | ||
]); | ||
} | ||
} |