Last active
January 3, 2016 17:08
-
-
Save skyowen/8493401 to your computer and use it in GitHub Desktop.
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 pymysql, sys | |
try: | |
conn = pymysql.connect(host='igor.gold.ac.uk', port = 3306, user = 'co304so', passwd = '**********', db = 'co304so_LondonCrime') | |
cur = conn.cursor() | |
cur.execute("CREATE TABLE AprilNov2012(Date DATE, Westminster VARCHAR(11), HACKNEY VARCHAR(7), Tower_Hamlets VARCHAR(13))") | |
data = cur.fetchall() | |
print data | |
except Exception as e: | |
print "couldn't connect to database" | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment