title: Two SELECT inside NOT IN echo array() mysql php, one SELECT IS OK
body: <p>my code is OK only if I remove one (SELECT) inside the NOT IN, if I add two (SELECT) inside the NOT IN, it echo array(); First, I want to get the fruit that val=those value and mark = 'major'. Then I want to remove any of those fruit that either the mark='age' or mark='ripe', so I used OR fruit NOT IN. I already check the SELECT inside the NOT IN, it is OK when they are alone. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  $dia = $wpdb-&gt;get_results( $wpdb-&gt;prepare("
     SELECT fruit FROM table WHERE val IN (%s,%s,%s) AND mark = 'major' OR fruit NOT IN (
  (SELECT fruit FROM table WHERE cat='uncommon' AND val = %s AND mark='age'), 
  (SELECT fruit FROM table WHERE cat='uncommon' AND val = %s AND mark='ripe')) GROUP BY fruit
     ",$sym1,$sym2,$sym3,$age,$ripe));
  
  
  
  ?&gt;</code></pre>
  </div>
  </div>
  </p>