Hi,
I'm trying to develop a function that will prepare output for converting into an Excel spreadsheet for phpexcel. In order to create the output I need to run the same type of query against a number of different tables. To start, I need to get the count of all of the values in the tables, so I run a single query to get all the values. Then, I need to get specific counts from individual tables. What I am wondering is whether there is a way to run a 'subquery' against the first query in order to reduce the number of times I need to hit the database.
So, my first query is:
<?php
$outline_query = new EntityFieldQuery();
$outline_query->entityCondition('entity_type', 'node')
->entityCondition('bundle',array('assembly', 'attributes', 'component', 'connection', 'coordinate', 'document', 'facility', 'floor', 'impact', 'issue', 'job', 'resource', 'space', 'spare', 'system', 'type', 'zone'))
->propertyCondition('status', 1)
->fieldCondition('field_relatedproject', 'nid', $projnid, "=");
$result = $outline_query->execute();
$count = $outline_query->count()->execute();
?>What I'm wondering is whether it is possible to run a query on that $result in order to get values from a single table? What I need is the $nid for all nodes of a specific node type.
Any help would be greatly appreciated.