SHARE
TWEET

Untitled

a guest Oct 13th, 2011 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. import MySQLdb
  4.  
  5. host='host'
  6. db='database'
  7. user='user'
  8. passwd='password'
  9.  
  10. if __name__=='__main__':
  11.         db=MySQLdb.connect(host=host,user=user,passwd=passwd,db=db)
  12.         c=db.cursor()
  13.         c.execute("select playername, password, registerip, UNIX_TIMESTAMP(lastlogindate) from xauth_accounts order by id")
  14.         result=[x for x in c.fetchall()]
  15.         for x in result:
  16.                 if x[2]==None or x[3]==None:
  17.                         x=x[0:2]+('8.8.8.8',)+('1316019105',)
  18.                 c.execute("insert into test (authme_username, password, ip, lastlogin) values ('"+x[0]+"','"+x[1]+"', '"+x[2]+"', '"+str(x[3])+"')"
  19.  
  20.         db.commit()
  21.  
  22.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top