title: PHP PDO - Bind table name?
body: <p>Is it possible to bind a table name?</p>
  
  <p>I want to make a class to read the columns from a tables and, depending on field type, generate the form inputs for me. When I do <code>$form = new form("users");</code>, the constructor is supposed to start with getting the field names from the table with the following code:</p>
  
  <pre><code>class form{
  
      public function __construct($table, $skip = array("id")){
          $pdo = new PDO('mysql:host=localhost;dbname=site;',USER,PASS);
  
          $query = $pdo-&gt;prepare("DESCRIBE :table");
  
          $query-&gt;bindValue(':table', $table, PDO::PARAM_STR, strlen($table));
  
          $query-&gt;execute();
  
          while($field = $query-&gt;fetch(PDO::FETCH_NUM)){
              var_dump($field);
              echo "&lt;br /&gt;&lt;br /&gt;";
          }
  
          unset($pdo);
      }
  }
  </code></pre>
  
  <p>This works just fine when I specify "users" instead of ":table" in the prepare statement, but the bind it's working, and I'm pretty sure it's because it's trying to bind a table name. Also, this needs to be binded because I'd like to have the ability to pass my table names through <code>$_GET</code> and the such.</p>