def hello():
my=createdb()
a=[]
page=request.form.get("pageIndex")
size=request.form.get("pageSize")
key=request.form.get("key")
my.execute("select * from age where xm like'%"+key+"%'")
cur1=my.fetchall()
for cur in cur1:
aa={'xm':cur[0],'age':cur[1],'class':cur[2]}
a.append(aa)
return jsonify(a)
my.execute("select * from age where xm like '%"+key+"%' limit "+str(start)+","+size)
cur1=my.fetchall()
for cur in cur1:
aa={'xm':cur[0],'age':cur[1],'class':cur[2]}
a.append(aa)
my.execute("select count(*) from age where xm like '%" + key + "%'")
count1 = my.fetchall()
#a.append(cur1)
#aa=[]
#aa1=jsonify(a)
aa2={'total':count1[0],'data':a}
#print(cur1)
return jsonify(aa2)