How to retrieve a query result in a computed field? I'm trying to run the following select in a computed field, but it doesn't work: any clue on what is going wrong ?

$nid = $node-&gt;nid;

$result = db_query('SELECT description FROM {taxonomy_term_data} AS ttd 
                    LEFT JOIN {taxonomy_index} AS ti ON ti.tid = ttd.tid 
                    WHERE ttd.vid = :vid AND ti.nid = :nid', 
                  array(':vid' =&gt; 16, ':nid' =&gt; $nid));

$entity_field[0]['value'] = $result;
db_query() doesn't return a column, to do this you need to fetch it using fetchField():

$nid = $node-&gt;nid;

$result = db_query('SELECT description FROM {taxonomy_term_data} AS ttd 
                    LEFT JOIN {taxonomy_index} AS ti ON ti.tid = ttd.tid 
                    WHERE ttd.vid = :vid AND ti.nid = :nid', 
                  array(':vid' =&gt; 16, ':nid' =&gt; $nid));

$entity_field[0]['value'] = $result-&gt;fetchField();