Forums

Using OR Conditions in CCv5

razlie 18 Feb, 2014
Hi,
Any one know how to do a OR conditions in conditions field ... I want to add conditions like this
<?php
return array(
  "session_profail" =>"06-06-2013",
  "type <>" => "",
  "status_borang" => "3",
  "lvl1" => "3",
  "lvl1" => "5"
);
?>
where lvl1 is either 3 OR 5 .. Anyone has idea?
warmbeach 29 Mar, 2014
See this post:

https://chronoengine.com/forums/posts/t94305.html
Max_admin 29 Mar, 2014
Answer
Hi,

For this situation, the solution would be to use "IN", which can be achieved easily by providing array of values :

"lvl1" => array("3", "5")


But to have OR, you should use:


<?php
return array(
  "session_profail" =>"06-06-2013",
  "type <>" => "",
  "status_borang" => "3",
"OR" => array(array("lvl1" => "3"), array("lvl1" => "5"))
);
?>


But since its only 1 field then its better to use "IN", not "OR"

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.