displaying content using entityfieldquery I want to display content based on term ids using below method.If I include the below code in for loop it works but thats not appropriate way to call loop for each index value.Here $all_children[] contains term ids. Can anyone please tell me what is wrong with below code , or any suggestions?

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node');
$query-&gt;entityCondition('bundle', 'escorts_product');
$query-&gt;propertyCondition('status', 1);
for($i=0;$i&lt;=20;$i++)
  {
   $query-&gt;fieldCondition('field_product_sub_cat', 'tid', $all_children[$i],'=');
  }
$result = $query-&gt;execute();
if (isset($result['node']))
  {
    print "nomeer";
    $nids =  array_keys($result['node']);
    nodes = node_load(array_keys($result['node'])); 
    if ((node_load($nids, NULL, TRUE)))
      {
       foreach($nids as $nid)
         {
          //content
         }
      }  
   }
I think this is the right way because it works for me. Error was in below line.

$query-&gt;fieldCondition('field_product_sub_cat', 'tid', $all_children[$i],'=');


Correct way to compare with array is:

 $query-&gt;fieldCondition('field_product_sub_cat', 'tid', array("$your_array_variable"));