All pastes #13142 Raw Edit

Something

public text v1 · immutable
#13142 ·published 2005-06-02 00:53 UTC
rendered paste body
>>> import MySQLdb
>>> db=MySQLdb.connect(host='localhost', user='root', db='boxstyle')
>>> c=db.cursor
>>> c.execute('select count(*) from items')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'function' object has no attribute 'execute'
>>> c=db.cursor()
>>> c.execute('select count(*) from items')
1L
>>> c.fetchone()
(188L,)
>>>