Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb
HTML Download (TGZ) - 83.7Kb
HTML Download (Zip) - 99.3Kb


10.5.14 MySQLCursor.rowcount Property

Syntax:

count = cursor.rowcount

This read-only property returns the number of rows returned for SELECT statements, or the number of rows affected by DML statements such as INSERT or UPDATE. For an example, see Section 10.5.4, “MySQLCursor.execute() Method”.

For nonbuffered cursors, the row count cannot be known before the rows have been fetched. In this case, the number of rows is -1 immediately after query execution and is incremented as rows are fetched.

The rowcount property is like the mysql_affected_rows() C API function; see mysql_affected_rows().


User Comments
Sign Up Login You must be logged in to post a comment.