1
Dave_L
Complex queries using criteria classes
  • 2006/10/19 20:34

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


[XOOPS 2.0.14]

Is it poosible to construct a complex where-clause, in which subexpressions must be grouped by parentheses, using the classes in class/criteria.php?

For example: WHERE a OR (b AND c = d)

If so, can you provide an code example?

2
phppp
Re: Complex queries using criteria classes
  • 2006/10/19 21:13

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


it can be done with criteriaCompo

$criteria =& new CriteriaCompo(new Criteria("field_a", "a"));
$criteria_sub =& new CriteriaCompo(new Criteria("field_b", "b"));
$criteria_sub->add(new Criteria("field_c", "c"));
$criteria->add($criteria_sub, "OR");

$criteria->render();

3
Dave_L
Re: Complex queries using criteria classes
  • 2006/10/20 11:26

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Thanks

Login

Who's Online

266 user(s) are online (165 user(s) are browsing Support Forums)


Members: 0


Guests: 266


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits