title: Fetching nid in drupal
body: <p>Here I want to fetch the nid of matching child term id from my content type product_categories. I used the below code.  </p>
  
  <pre><code>$query = new EntityFieldQuery();
  $query-&gt;entityCondition('entity_type', 'node');
  $query-&gt;entityCondition('bundle', 'product_categories');
  $query-&gt;propertyCondition('status', 1);
  $query-&gt;fieldCondition('field_product_sub_cat', 'tid', $child-&gt;tid, '=');
  $result = $query-&gt;execute();
  </code></pre>
  
  <p>I execute the above query and it displays correct results.But now I want to fetch the nid, I used below code but its not working.</p>
  
  <pre><code>$childnid = $result-&gt;nid; //Area to explore
  //print "&lt;pre&gt;"; print_r ((int)$childnid);
  print $childnid;
  </code></pre>
  
  <p>can anybody please help me ??</p>