title: Using 'OR' between HAVING and WHERE clause in MySQL?
body: <p>I am trying to fetch records in MySQL using a simple used submitted field. More precisely, the user inputs a name (firstname or lastname or fullname) and the server should return matched rows.</p>
  
  <p>What I am doing so far is something like:</p>
  
  <pre><code>SELECT * FROM people 
  WHERE 
     firstname LIKE '%user_submitted_data%' OR 
     lastname LIKE '%user_submitted_data%'
  </code></pre>
  
  <p>That works well for now, but that (obviously) won't work when a user submits the fullname. Is there a way to add a OR between the whole 'WHERE type conditions' and the 'HAVING type conditions'? This way I could do something like:</p>
  
  <pre><code>SELECT [some fields], CONCAT(firstname, ' ', 'lastname') as fullname 
  FROM people 
  WHERE 
     firstname LIKE '%user_submitted_data%' OR 
     lastname LIKE '%user_submitted_data%' OR 
     HAVING fullname LIKE '%user_submitted_data%'
  </code></pre>
  
  <p>I know I could just split the original string but that has some negative impact since you have to deal with names containing spaces such as 'De Gaule' and stuff like that.</p>