title: Combining different table queries in db with PHP and displaying all results on one page
body: <p>I have been trying to create a database for fun to get a better understanding of databases and using PHP to query them for a website I'm messing around with. Pretty much I have one database with 4 tables when a user enters a search term in a PHP search box my code searches the database for any entries containing the search term. Now I can easily get my code to search individual tables, but I cannot seem to get it to search all 4 tables and display the results on the same page.</p>
  
  <p>info: making a database for skyrim</p>
  
  <ul>
  <li><strong>Table names:</strong> classes, powers, skills, shouts</li>
  <li><strong>column names:</strong> name, information</li>
  </ul>
  
  <p>Here is a snippet of the code I have that works so far:</p>
  
  <pre><code>$raw_results = mysql_query("
     SELECT *
     FROM   `xaviorin_skyrim`.`shouts` , `xaviorin_skyrim`.`classes`
     WHERE  (CONVERT(`UID` USING utf8) LIKE '%".$query."%' OR
            CONVERT(`Name` USING utf8) LIKE '%".$query."%' OR 
            CONVERT(`Information` USING utf8) LIKE '%".$query."%')
  ") or die(mysql_error());`
  </code></pre>
  
  <p>Literally all I thought I would need to do is change the table name from "shouts"  to say "classes" in a new <code>raw_results</code> line of code but that didn't work. I have attempted unions and joins and either keep screwing them up or just don't understand how to properly format them. </p>
  
  <pre><code>echo "&lt;p&gt;&lt;h3&gt;".$results['Name']."&lt;/h3&gt;".$results['Information']."&lt;/p&gt;";
  </code></pre>
  
  <p>The code above this text is what displays the results on the page on my website... it works but I don't know how to combine the information from all 4 tables into one page. If I'm going about this in the wrong way and anyone can point me in the right direction I would GREATLY appreciate it... I've been trying to research the problem without finding a proper answer for near a month now.</p>