Skip to content

Commit

Permalink
修改 (#2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvivi authored and michaelliao committed Sep 22, 2017
1 parent 7f46cb9 commit 3b42cea
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions 0.000a学习/git.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#/usr/bin/python
# -*- coding: UTF-8 -*-
import pymysql
# 创建连接
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='root', db='db', charset='utf8')
#创建游标
cursor = conn.cursor()
cursor.execute("select * from ww_link")

# 获取剩余结果的第一行数据
# row_1 = cursor.fetchone()
# print row_1
# 获取剩余结果前n行数据
# row_2 = cursor.fetchmany(3)

# 获取剩余结果所有数据
row_3 = cursor.fetchall()
print row_3
conn.commit()
cursor.close()
conn.close()



0 comments on commit 3b42cea

Please sign in to comment.