How to use variable for SQLite table name
<p>I have a program where the user can select what table they want to modify in SQLite. I store the selection in a variable called <code>table</code>, then try and select everything from that table</p>

<pre><code>c.execute('SELECT * FROM ?', (table,))
</code></pre>

<p>The program gets stuck at the question mark. It says:</p>

<blockquote>
  <p>"Sqlite3.OperationalError: near "?": syntax error"</p>
</blockquote>

<p>What am I doing wrong?</p>