文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>python数据库操作小工具[整理]

python数据库操作小工具[整理]

时间:2010-06-25  来源:hkebao

#-*-coding:utf-8-*-
import MySQLdb
conn = MySQLdb.connect("localhost","root","321","tymoney",port=3306,connect_timeout=10,compress=True,charset='utf8',use_unicode=True)
cursor=conn.cursor()
cursor.execute("select count(*) from accountrecord ")
row = cursor.fetchone()
recordtotal = row[0]
perrecord = 50
if recordtotal % perrecord != 0:
    totalpage = recordtotal/perrecord + 1
else:totalpage = recordtotal/perrecord
for i in xrange(0,totalpage):
    prelimit = i*perrecord
    dysql = "select * from accountrecord limit " + str(prelimit) + "," + str(perrecord)
    print dysql


相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载