how do i move to next record after i click a button called 'Next' and how do i move to previous record after i click 'Previous' in MySQLdb. does method exists to do this?
please help me...........
import MySQLdb
from Tkinter import *
db=MySQLdb.connect(host='127.0.01',user='',passwd='',db='Trimtabs')
print 'mysql got connected.....'
cursor=db.cursor()
root=Tkinter.Tk()
e=Entry(root)
query="""select * from ticker"""
cursor.execute(query)
result=cursor.fetchall()
#value=StringVar()
#value.set(result[0])
print result
#e=Entry(root,textvariable=value)
def nextrec():
res=cursor.nextset()
#res=result[0]
#e.config(text='')
e.delete(0,10)
e.insert(0,res[0])
#pass
def previousrec():
#db.previous()
pass
b1=Button(root,text="Next",command=nextrec)
b2=Button(root,text="Previous",command=previousrec)
b1.pack()
b2.pack()
e.insert(1,result)
e.pack()
root.mainloop()