21 lines
497 B
Python
21 lines
497 B
Python
#!/usr/bin/python3
|
|
import sqlite3
|
|
import os
|
|
|
|
userid = input("Insert ID: ")
|
|
changewhat = input("Change what value?: ")
|
|
towhat = input("What should " + changewhat + " be changed to?: ")
|
|
|
|
def get_db_connection():
|
|
conn = sqlite3.connect("database.db")
|
|
conn.row_factory = sqlite3.Row
|
|
return conn
|
|
|
|
conn = get_db_connection()
|
|
conn.execute("UPDATE users SET " + changewhat + " = ?"
|
|
" WHERE id = ?",
|
|
(str(towhat), userid))
|
|
conn.commit()
|
|
conn.close()
|
|
|
|
print("Success!") |