Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement