EFQ SQL error when using filedCondition on two different taxonomy terms I'm using the below code to select a 'store' content type which has two taxonomy fields: category and brand.

$queryStore = new EntityFieldQuery();
$queryStore-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle','store', '=')
  -&gt;propertyCondition('status', NODE_PUBLISHED)
  -&gt;fieldCondition('field_city','tid', $city_id, '=')      
  -&gt;addMetaData('account', user_load(1))
  -&gt;execute;  

 if ($_GET['category'] != 'Choose a category'){
   $queryStore-&gt;fieldCondition('field_category','tid', $category_id, '=');
 }
 if ($_GET['brand'] != '') {
   $queryStore-&gt;fieldCondition('field_brand','tid', $brand_id, '=');
 }


However when I choose a brand like Chanel and a category like Food (naturally such node doesn't exist since Chanel doesn't do food), I get the following error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND (field_data_field_city0.deleted...

I'm using Drupal 7.
Is there a way to avoid such error? 
I appreciate any help given

Thanks
If you check your error you will notice that your query is trying to look for a column named field_data_field_city0.deleted... , it appends a 0 to it. This problem occurs because the type of value you choose for that column in field query is not correct.

Can you check an confirm if field_city is a taxonomy type of field. If you can access your DB check the table field_data_field_city and check what is the name of last column.