[Tutor] TypeError with _mysql module.result.num_rows()

Lloyd Kvam pythontutor at venix.com
Tue Sep 2 10:32:10 EDT 2003


This sequence of commands worked for me.

Does this query work when using the Python DBI (version 2)?
http://www.python.org/peps/pep-0249.html
PEP 249 -- Python Database API Specification v2.0
You'd be importing MySQLdb which wraps the _mysql module with the python
classes to support the standard DB interface.

Jozsa Boti wrote:

> Hi,
>  
> Why do I get a
> TypeError: function takes no arguments
> error for a call to num_rows() method of a result object in _mysql module?
> My usage is:
>  
> import _mysql
> db = _mysql.connect()
> db.query("""show table status""")
> res = db.store_result()
> nrws = res.num_rows()
>  
> and the error message is:
>  
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
> TypeError: function takes no arguments
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-443-6155
fax:	801-459-9582




More information about the Tutor mailing list