Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix binding values #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marliotto wants to merge 2 commits into FriendsOfDoctrine:master
base: master
Choose a base branch
Loading
from marliotto:fix-binding

Conversation

Copy link

@marliotto marliotto commented Apr 26, 2019

Hello,
I've fixed rewriting values when values was been set through bindValue().
For example:

$statement = $this->connection->prepare('INSERT INTO test_insert_table(id, payload) VALUES (?, ?), (?, ?)');
$statement->bindValue(0, 7, ParameterType::INTEGER);
$statement->bindValue(1, 'v?7');
$statement->bindValue(2, 8, ParameterType::INTEGER);
$statement->bindValue(3, 'v8');

Result SQL:

INSERT INTO test_insert_table(id, payload) VALUES (7, 'v87'), ('v8', ?)

Fixed bug with keys that have the same prefix.
For example:

$statement = $this->connection->prepare('INSERT INTO test_insert_table(id, payload) VALUES (:v1, :v10)');
$statement->execute(['v1' => 1, 'v10' => 'v1');

Also, new solution supports keys like '?' and ':key' in one query.

dmytroboiko reacted with thumbs up emoji
Copy link
Author

Hello @mochalygin , @argayash ! Could you check my PR?
It will fix #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /