Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''test script to investigate implementation into bot'''
- import sqlite3
- conn = sqlite3.connect('example.db')
- c = conn.cursor()
- try:
- c.execute('''CREATE TABLE members
- (bangorid text, surname text, forename text, email text, mobile text, school text, studyyear int)''')
- except sqlite3.Error, e:
- print "An error occured: " + e.args[0]
- c.execute('''DELETE FROM members''')
- c.execute('''INSERT INTO members VALUES ('psuc44', 'Preston', 'Shaun', 'shaunpreston1991@gmail.com', '07510309724', 'SEECS', 2)''')
- c.execute('''INSERT INTO members VALUES ('psuc45', 'Preston', 'Shaun', 'shaunpreston1992@gmail.com', '07510309724', 'SEECS', 1)''')
- c.execute('''INSERT INTO members VALUES ('psuc46', 'Preston', 'Shaun', 'shaunpreston1993@gmail.com', '07510309724', 'SEECS', 2)''')
- c.execute('''INSERT INTO members VALUES ('psuc47', 'Preston', 'Shaun', 'shaunpreston1994@gmail.com', '07510309724', 'SEECS', 3)''')
- conn.commit()
- userid = 'psuc44'
- if c.execute('SELECT forename FROM members WHERE bangorid=\''+userid+'\'') != '':
- print 'True'
- for row in c.execute('SELECT * FROM members'):
- print row
Add Comment
Please, Sign In to add comment