Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # Simple routine to run a query on a database and print the results:
- # UA_BRAIN
- class UserAccount:
- import MySQLdb
- hostname = 'http://ec2-52-59-192-235.eu-central-1.compute.amazonaws.com'
- username = 'root'
- password = 'nks0ndgj'
- database = 'transaction_module'
- def doQuery( conn ) :
- print("ahoj")
- cur = conn.cursor()
- cur.execute( "SELECT * FROM user_activity" )
- for value in cur.fetchall() :
- print(value)
- print("Using MySQLdb…")
- myConnection = MySQLdb.connect( host=UserAccount.hostname, user=UserAccount.username, passwd=UserAccount.password, db=UserAccount.database )
- doQuery( myConnection )
- myConnection.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement