-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlrun.py
66 lines (61 loc) · 2 KB
/
sqlrun.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import sqlite3
import bcrypt
eingabe =""
while eingabe != "exit":
eingabe = raw_input("eingabe: ")
if eingabe == "4":
db = sqlite3.connect("devside.db")
c = db.cursor()
c.execute("SELECT * FROM users WHERE usermail='[email protected]'")
print c.fetchone()
db.close()
if eingabe == "1":
baka1 = "lol"
baka2 = "blizzard"
baka3 = "baka"
userpass = bcrypt.hashpw(baka3, bcrypt.gensalt())
conn = sqlite3.connect("devside.db")
c = conn.cursor()
c.execute("DROP TABLE users")
c.execute("""
CREATE TABLE users(
User_ID INTEGER PRIMARY KEY AUTOINCREMENT,
usermail TEXT,
username TEXT,
userpass TEXT);
""")
c.execute("INSERT INTO users(usermail, username, userpass) VALUES ('[email protected]', '"+ "baka" + "', '" + userpass + "')")
#c.execute("INSERT INTO users(usermail, username, userpass) VALUES ('"+baka1 + "', '" + baka2 + "', '"+baka3+"')")
c.execute("SELECT * FROM users ")
print c.fetchone()
conn.commit()
conn.close()
if eingabe == "2":
db = sqlite3.connect("devside.db")
c = db.cursor()
c.execute("""
CREATE TABLE entries(
entrie_ID INTEGER PRIMARY KEY AUTOINCREMENT,
autor TEXT,
datum VARCHAR(10),
titel TEXT,
news TEXT);""")
db.commit()
db.close()
if eingabe == "3":
db = sqlite3.connect("devside.db")
c = db.cursor()
print c.execute("SELECT * FROM entries")
c.execute("SELECT * FROM entries WHERE entrie_ID=0")
baka= c.fetchall
db.commit()
print baka
db.close()
if eingabe == "4":
db = sqlite3.connect("devside.db")
c = db.cursor()
c.execute("CREATE TABLE projektlinks(Projekt_ID INTEGER PRIMARY KEY AUTOINCREMENT, projektlink TEXT);")
db.close()
if eingabe == "5":
db = sqlite3.connect("devside.db")
c = db.cursor()