Last active
July 14, 2017 16:32
-
-
Save ghousseyn/60e6692f07156b6e02b35d60860fddd1 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 | |
conn = pymysql.connect(host='localhost', port=3356, user='root', passwd='1234', db='dev') | |
cur = conn.cursor() | |
#cur.execute("CREATE TABLE coda (id int(11) not null AUTO_INCREMENT, name varchar(20) null, age int(2) null, PRIMARY KEY(id))") | |
cur.execute("INSERT INTO coda (name, age) VALUES ('hafid', 33)") | |
conn.commit() | |
cur.execute("SELECT * FROM coda") | |
#results = cur.fetchall() | |
print() | |
for row in cur: | |
print(row) | |
cur.close() | |
conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment