idiorm icon indicating copy to clipboard operation
idiorm copied to clipboard

Update querying.rst

Open p9s opened this issue 1 year ago • 3 comments

p9s avatar Mar 14 '24 07:03 p9s

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' ))

p9s avatar Mar 14 '24 08:03 p9s

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

treffynnon avatar Mar 14 '24 08:03 treffynnon

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

p9s avatar Mar 15 '24 01:03 p9s