1
cursor.execute("SELECT SQL_CALC_FOUND_ROWS user_id FROM...limit 5")
rows = cursor.fetchall()
...
total_rows = cursor.execute("SELECT FOUND_ROWS()") #this doesn't work for some reason.
編輯:我想SELECT FOUND_ROWS()FROM MY_TABLE ...和數字是時髦。如何在python MySQLdb的執行SQL_CALC_FOUND_ROWS
感謝BTW。我不知道'SQL_CALC_FOUND_ROWS/SELECT FOUND_ROWS()':D – 2010-03-08 11:34:10