Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import MySQLdb
- host='host'
- db='database'
- user='user'
- passwd='password'
- if __name__=='__main__':
- db=MySQLdb.connect(host=host,user=user,passwd=passwd,db=db)
- c=db.cursor()
- c.execute("select playername, password, registerip, UNIX_TIMESTAMP(lastlogindate) from xauth_accounts order by id")
- result=[x for x in c.fetchall()]
- for x in result:
- if x[2]==None or x[3]==None:
- x=x[0:2]+('8.8.8.8',)+('1316019105',)
- c.execute("insert into test (authme_username, password, ip, lastlogin) values ('"+x[0]+"','"+x[1]+"', '"+x[2]+"', '"+str(x[3])+"')"
- db.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement