title: PDO execute with array returns null
body: <p>I'm trying to use good PDO as always and almost everything works but one query:</p>
  
  <pre><code>$primary = 'my_id';
  $table = 'my_table';
  // This or...
  $statement = $this-&gt;conn-&gt;prepare("SELECT MAX(:id) AS id FROM :table");
          $statement-&gt;bindParam(':id', $primary, PDO::PARAM_STR);
          $statement-&gt;bindParam(':table', $table, PDO::PARAM_STR);
          $statement-&gt;setFetchMode(PDO::FETCH_ASSOC);
          $statement-&gt;execute();
  
  // This one. Both doesn't work.
  
  $statement = $this-&gt;conn-&gt;prepare("SELECT MAX(:id) AS id FROM :table");
          $statement-&gt;setFetchMode(PDO::FETCH_ASSOC);
  $arr = array(
              ':id' =&gt; 'my_id',
              ':table' =&gt; 'my_table',
          );
          $statement-&gt;execute($arr);
  </code></pre>
  
  <p>These just return a null array. I feel so confused. So I have tried that:</p>
  
  <pre><code>$statement = $this-&gt;conn-&gt;prepare("SELECT MAX(".$primary.") AS id FROM ".$table);
          $statement-&gt;setFetchMode(PDO::FETCH_ASSOC);
          $statement-&gt;execute();
  </code></pre>
  
  <p>And it works. I feel like I'm missing something but can't figure it out. So clearly there's a problem with binding I tried different variations such as writing one of the variable manually, but no luck so far.</p>
  
  <p>Thanks in advance for any help...</p>