How do I execute SQL_CALC_FOUND_ROWS in python MySQLDB
        Posted  
        
            by alex
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by alex
        
        
        
        Published on 2010-03-08T10:06:50Z
        Indexed on 
            2010/03/08
            11:36 UTC
        
        
        Read the original article
        Hit count: 309
        
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.
© Stack Overflow or respective owner