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.
Edit: I tried SELECT FOUND_ROWS() FROM my_table...and the numbers are funky.