daily pastebin goal
73%
SHARE
TWEET

Untitled

a guest Jul 21st, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python
  2.  
  3.  
  4. # Simple routine to run a query on a database and print the results:
  5.  
  6.  
  7. # UA_BRAIN
  8. class UserAccount:
  9.     import MySQLdb
  10.  
  11.     hostname = 'http://ec2-52-59-192-235.eu-central-1.compute.amazonaws.com'
  12.     username = 'root'
  13.     password = 'nks0ndgj'
  14.     database = 'transaction_module'
  15.     def doQuery( conn ) :
  16.         print("ahoj")
  17.         cur = conn.cursor()
  18.  
  19.         cur.execute( "SELECT * FROM user_activity" )
  20.  
  21.         for value in cur.fetchall() :
  22.             print(value)
  23.  
  24.     print("Using MySQLdb…")
  25.     myConnection = MySQLdb.connect( host=UserAccount.hostname, user=UserAccount.username, passwd=UserAccount.password, db=UserAccount.database )
  26.     doQuery( myConnection )
  27.     myConnection.close()
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