Updating a filename's counter value failed each time

John Gordon gordon at panix.com
Mon Jun 17 15:19:26 EDT 2013


In <kpne3k$1066$1 at news.ntua.gr> Simpleton <support at superhost.gr> writes:

> if form.getvalue('filename'):
> 	cur.execute('''UPDATE files SET hits = hits + 1, host = %s, lastvisit = 
> %s WHERE url = %s''', (host, lastvisit, filename) )

Add an 'else' statement above that prints something, so you will at least
know if the UPDATE statement is ever executed.

Print the cur.rowcount attribute, which contains the number of rows that
were affected by the update.  If it's zero, that should tell you something.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list