title: How to use placeholders for the column and table names in sqlite3 statements, when '?' does not work?
body: <p>For some reason I am getting errors when using placeholders in <code>select</code> statements.</p>
  <pre><code>def get_id(table_name, id_name):
      db = sqlite3.connect('test_db')
      max_id = db.execute('''SELECT max(?) FROM ?''', (id_name, table_name)).fetchone()[0]
      if not max_id:
          primary_id = 0
      else:
          primary_id = max_id + 1
  </code></pre>
  <p>This functions returns this error:</p>
  <pre class="lang-none prettyprint-override"><code>File &quot;test.py&quot;, line 77, in get_id
  max_id = db.execute('''SELECT max(?) FROM ?''', (id_name, table_name)).fetchone()[0]
  sqlite3.OperationalError: near &quot;?&quot;: syntax error
  </code></pre>