condition()
doesn't take an array as argument.
You need to replace $query->condition(array('f.status', 1, '=', 'f.country_value', 'Afghanistan', '='));
with the following lines.
// The third argument isn't necessary as `=` is the dafault operator, in this case.
$query->condition('f.status', 1);
$query->condition('f.country_value', 'Afghanistan');
The query is using the value of the status
field, but that isn't added to the list of fields passed to $query->fields()
.
group
is a reserved word in MySQL 5.5; it cannot be used as identifier for a table field.