title: Displaying all table names in php from MySQL database
body: <p>Alright, so I'm fairly new to PHP and SQL/MySQL so any help is appreciated.</p>
  
  <p>I feel like I took the right approach. I searched php.net for "MySQL show all table names", it returned a deprecated method and suggested using a MySQL query on <code>SHOW TABLES [FROM db_name] [LIKE 'pattern']</code> I'm not sure what "pattern" means but, I searched for "SQL Wildcard" and got the "%" symbol. According to everything I found, this should work and output the table names at the end, but it does not. Any suggestions? Thanks in advance.</p>
  
  <pre><code>&lt;?php
  if ($_REQUEST["username"]=="coke"&amp;&amp;$_REQUEST["password"]=="pepsi"){
  echo 'You have successfully logged in.';
  echo '&lt;br /&gt;';
  echo 'These are your tables:';
  echo '&lt;br /&gt;';
  
     $link = mysql_connect("sql2.njit.edu", "username", "password");
  
     mysql_select_db("db_name") or die(mysql_error());
  
     $result = mysql_query('SHOW TABLES [FROM db_name] [LIKE '%']');
     echo $result;
  }
  else
  echo 'You did not provide the proper authentication';
  ?&gt;
  </code></pre>
  
  <p>I get no errors. The output is exactly what's echoed, but no table names.</p>