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

Update querying.rst #378

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update querying.rst #378

wants to merge 1 commit into from

Conversation

p9s
Copy link

@p9s p9s commented Mar 14, 2024

No description provided.

Copy link
Collaborator

@treffynnon treffynnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original looks correct to me

@p9s
Copy link
Author

p9s commented Mar 14, 2024

the seconds args: array('age' => '>'), will change all age column to use '>' operator

please try this simple demo here.

➜ demo cat index.php

where_any_is(array( array('name' => 'Joe', 'age' => 10), array('name' => 'Fred', 'age' => 20)), array('age' => '>')) ->find_many(); echo ORM::get_last_query() . "\r\n"; ?>

➜ demo php index.php
SELECT * FROM person WHERE (( name = 'Joe' AND age > '10' ) OR ( name = 'Fred' AND age > '20' ))

@treffynnon
Copy link
Collaborator

Yeah that's a different query. Note the extra array with '>' in it?

@p9s
Copy link
Author

p9s commented Mar 15, 2024

yes, the ORM final generate SQL is correct.
but, in doc write a wrong SQL example. see my pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants