title: Combining multiple Wordpress database queries
body: <p>Forgive me for re-wording and re-asking this question, but the answers I received a couple weeks back didn't help much...</p>
  
  <p>Basically, I'm looking to somehow combine multiple database queries in Wordpress to retrieve user IDs by searching for term in the 'usermeta' table, but only entries that have a certain 'meta_value'</p>
  
  <p><strong>I'm trying to combine:</strong></p>
  
  <pre><code>$users = $wpdb-&gt;get_results("SELECT user_id, meta_value as 'business_name' 
  FROM $wpdb-&gt;usermeta
  WHERE meta_key = 'business_name'");
  </code></pre>
  
  <p><strong>AND:</strong></p>
  
  <pre><code>$users = $wpdb-&gt;get_results("SELECT user_id, meta_value as 'business_description' 
  FROM $wpdb-&gt;usermeta
  WHERE meta_key = 'business_description'");
  </code></pre>
  
  <p><strong>To essentially have this:</strong></p>
  
  <pre><code>$users = $wpdb-&gt;get_results("SELECT user_id, business_name, business_description 
  FROM 
  WHERE
      business_name LIKE '%{$keyword}%' OR
      business_description LIKE '%{$keyword}%'");
  </code></pre>
  
  <p>I've looked into INNER JOINs and subqueries, but cannot seem to find a good solution.  I realize that I can get away with multiple queries, but this would be searching through possibly thousands of entries, so I'd like to optimize it as much as possible.</p>