Dennis Lee Bieber wrote:
> On Thu, 26 Apr 2007 18:18:57 -0700, John Nagle <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>> Carl K wrote:
>>> using MySQLdb, I do cursor.execute("update...")
>>>
>>> How can I tell how many rows were affected ?
>>>
>>> Carl K
>> cursor = d
John Nagle wrote:
> Carl K wrote:
>> using MySQLdb, I do cursor.execute("update...")
>>
>> How can I tell how many rows were affected ?
>>
>> Carl K
>
> cursor = db.cursor() # get cursor
> cursor.execute(sqlstatement, argtuple) # do command
> rowsaffected = cursor.ro
Carl K wrote:
> using MySQLdb, I do cursor.execute("update...")
>
> How can I tell how many rows were affected ?
>
> Carl K
cursor = db.cursor() # get cursor
cursor.execute(sqlstatement, argtuple) # do command
rowsaffected = cursor.r
Both cursor.execute() and cursor.executemany() return the number of rows
affected.
Here is a link to the documentation:
http://mysql-python.sourceforge.net/MySQLdb-1.2.2/public/MySQLdb.cursors.BaseCursor-class.html#execute
Ian
On 4/26/07, Carl K <[EMAIL PROTECTED]> wrote:
using MySQLdb, I do
using MySQLdb, I do cursor.execute("update...")
How can I tell how many rows were affected ?
Carl K
--
http://mail.python.org/mailman/listinfo/python-list