title: multiple keyword search script needs some expert input
body: <p>I have been writting a keyword search script based on this tutorial:
  <a href="http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/" rel="nofollow noreferrer">http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/</a></p>
  
  <p>Like some of the commenters mentioned, the script only ends up returning results based on the last word in the search terms. So I have also tried to implement one of the suggestions from another user, but now I seem to only be able to get results based on the first search term.</p>
  
  <p>The code for my script can be found here: <a href="http://php.pastebin.com/m7759afd3" rel="nofollow noreferrer">http://php.pastebin.com/m7759afd3</a></p>
  
  <p>My print_r for the results looks like this:</p>
  
  <pre><code>SELECT * FROM blog WHERE blog_title LIKE '%barry%' OR blog_content LIKE '%barry%' AND blog_title LIKE '%child%' OR blog_content LIKE '%child%' AND blog_title LIKE '%help%' OR blog_content LIKE '%help%' ORDER BY blog_title
  
  SELECT * FROM links WHERE link_title LIKE '%barry%' OR link_desc LIKE '%barry%' AND link_title LIKE '%child%' OR link_desc LIKE '%child%' AND link_title LIKE '%help%' OR link_desc LIKE '%help%' ORDER BY link_title
  
  SELECT * FROM pages WHERE page_title LIKE '%barry%' OR page_content LIKE '%barry%' AND page_title LIKE '%child%' OR page_content LIKE '%child%' AND page_title LIKE '%help%' OR page_content LIKE '%help%' ORDER BY page_title
  </code></pre>
  
  <p>Thank you for any help you might be able to offer.</p>