sql update set ? = ? where ? = ? (python, sqlite3)
<p>Python, slite3</p>

<pre><code>c.execute("UPDATE accounts SET ? = ? WHERE num=?", (db['choise'], db['data'], db['num']))
</code></pre>

<p>so i don't know what is wrong with it</p>

<p>db is shelve database</p>

<p>Column names cannot be given as arguments. You can try  </p>

<pre><code>c.execute("UPDATE accounts SET "+str(db['choise'])+" = ? WHERE num=?", (db['data'], db['num']))
</code></pre>

python sqlite3