Created
December 27, 2010 11:19
-
-
Save mvaz/756057 to your computer and use it in GitHub Desktop.
Using MySQLdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MySQLdb | |
conn = MySQLdb.Connect(host="localhost", port=3306, user="mvaz", passwd="whatever", db="trades") | |
cursor = conn.cursor() | |
sql = "select * from Users" | |
cursor.execute(sql) | |
rows = cursor.fetchall() | |
for row in rows: | |
print row | |
conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment