Error in db_query statement - d7
Try it without the $query->execute(); as according to the docs for db_query the function already executes the query and returns a result.

Try this:

$args = array(':entities' =&gt; $_REQUEST['entities'], ':countries'=&gt;$_REQUEST['countries']);
$result = db_query("SELECT field_entity_value,field_country_value, filename
                   FROM field_data_field_entity,field_data_field_country , field_revision_field_file_upload, file_managed
                   WHERE ( field_data_field_entity.field_entity_value LIKE :entities
                   AND field_data_field_country.field_country_value= :countries )
                   AND field_data_field_entity.entity_id = field_revision_field_file_upload.entity_id
                   AND field_data_field_country.entity_id= field_data_field_entity.entity_id
                   AND field_revision_field_file_upload.field_file_upload_fid=file_managed.fid", $args);


I would say the error is from trying to execute a result.