data["id"] AND "office_id" => $form->data["office"]);The above code doesn't work. What would be the proper way to right the statement?Thanks"> How can I meet 2 different conditions - Forums

Forums

How can I meet 2 different conditions

Tgoodrich 22 May, 2014
Hi,

I have 2 different id's in the link to my form. "office" and "id"

I am trying to right a statement in the db read conditions to pick up both id's but can't seem to get it right. To get the right information both conditions need to be met.

Here's and example of what I've tried:
<?php
return array("member_id" => $form->data["id"] AND "office_id" => $form->data["office"]);


The above code doesn't work. What would be the proper way to right the statement?

Thanks
Tgoodrich 22 May, 2014
Sorry Calculus00, doesn't help.
Tgoodrich 22 May, 2014
Answer
Hi again,

I was able to figure it out, pretty simple actually!😀

Here is the code i inserted into the conditions box:
<?php
return array("office_id" => $form->data("office"), "member_id" => $form->data("id"));


Now when I click the link to the form it checks the "office_id" and "member_id" so that the correct form is opened.
GreyHead 23 May, 2014
1 Likes
Hi Tim,

A bit late, but there's a FAQ here where I've started to add some examples (I just added the AND one).

Bob
Tgoodrich 23 May, 2014
Hi Bob,

Thanks for letting me know thats there now.🙂

One thing though, I needed the information to use in CFv5 and you have listed the faq under CCv5. I'll be honest I never would have thought to check it since I was working with CFv5. I know its there now but others my not think to check the faq's for CCv5 if they are working with CFv5. Since it appears to pertain to both CFv5 and CCv5, should you also list it under the CFv5 faqs?

Thanks
GreyHead 23 May, 2014
1 Likes
Hi Tim,

Thanks, I've added a CFv5 FAQ - it's only a link to the CCv5 one but should make that easier to find.

Bob
This topic is locked and no more replies can be posted.