Hello,
i want ask somthing about mysql in multi pages i hope someone help me
and sorry about my English
this code works good but there problem if i used it with this tybe
sql = "SELECT * FROM emaillogs ORDER BY id DESC"
cursor.execute(sql)
results = cursor.fetchall()
if page <= "1":
for row in results[0:30]:
print row
else:
NUM2 = int(page) * 30
NUM1 = NUM2 - 30
for row in results[int(NUM1):int(NUM2)]:
print row
and the page link will be domain.com/file.py?do=emaillogs&page=1
this code if big data in table will cause load and long time to process because the sql code will get all rows in the table in memory and python code "for row in results[0:30]:" will show after that 30 only in the page at browser
i want code get data limit direct from mysql code