title: Check if MySQL table exists or not
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1525784/mysql-check-if-a-table-exists-without-throwing-an-exception">MySQL check if a table exists without throwing an exception</a>  </p>
  </blockquote>
  
  
  
  <p>I have a dynamic mysql query builder in my project that creates select queries from different tables.<br>
  I need to check if the current processing table exists or not.<br>
  Imagine that my tables are table1, table2, and table3. My code is something like this:  </p>
  
  <pre><code>&lt;?php
  for($i = 1 ; $i &lt;= 3 ; $i++) {
     $this_table = 'table'.$i;
     $query = mysql_query("SELECT * FROM $this_table");
     // ...
  }
  ?&gt;
  </code></pre>
  
  <p>How can I do this check (Please tell me the simplest way).</p>