1

This question already has an answer here:

could you help me to fix my problem? note: each user have two field (fields are taxonomy reference)

I want to get two fields with OR condition the output of my code returns in the shape of AND result

here is my code :

 $query = new EntityFieldQuery();
  $query->entityCondition('entity_type', 'user')
        ->propertyCondition('status', 1)
        ->fieldCondition('field_software_abilities', 'tid', $abilities, 'IN')
    ->fieldCondition('field_other_abilities', 'tid', $abilities, 'IN');
    $result = $query->execute();

I read an article about using addtag and hook_query_tag_alter() but I can't use it

marked as duplicate by Clive May 27 '14 at 8:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

EntityFieldQuery does not support 'OR' operators. There is a workaround presented here 'OR' Queries with EntityFieldQuery where an 'OR' operator is added.

  • thank you for your answer I read this article but I can't use it in my code would you please tell me how I can use that? – Niloofar Bahrami May 27 '14 at 9:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.