My query return me an error. I have the gid of a organic group. I want to retrieve the last news for this group.
$query = db_select('node','n');
$result = $query
->fields('n')
->condition('type','news','=')
->join('field_data_group_audience','fdga','n.nid = fdga.entity_id AND fdga.group_audience_gid = :gid', array(':gid' => $gid))
->execute();
This query give me a : Fatal error: Call to a member function execute() on a non-object
Thanks