Skip to content
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

Multiple conditions by subselects are skipped #109

Closed
norbe opened this issue Dec 2, 2015 · 3 comments
Closed

Multiple conditions by subselects are skipped #109

norbe opened this issue Dec 2, 2015 · 3 comments

Comments

@norbe
Copy link
Contributor

@norbe norbe commented Dec 2, 2015

If I call multiple times

$context->table('product')
      ->where('product.id', $selection1)
      ->where('product.id', $selection2);

only first condition is used and second is skipped.

Its caused by this line of SqlBuilder, as json_encode convers selection to '{}' string.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Dec 2, 2015

Can you fix it?

@norbe

This comment has been minimized.

Copy link
Contributor Author

@norbe norbe commented Dec 3, 2015

Yes, but I'm not sure how. Should I use JsonSerializable in Selection (supported by PHP >= 5.4.0) and convert the selection to query string?

@Unlink

This comment has been minimized.

Copy link
Contributor

@Unlink Unlink commented Dec 3, 2015

norbe added a commit to norbe/database that referenced this issue Feb 24, 2016
norbe added a commit to norbe/database that referenced this issue Feb 24, 2016
norbe added a commit to norbe/database that referenced this issue Mar 4, 2016
@dg dg closed this in c2d7542 Mar 4, 2016
dg added a commit that referenced this issue Mar 4, 2016
dg added a commit that referenced this issue Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.