Updating a filename's counter value failed each time

Νίκος support at superhost.gr
Mon Jun 17 15:28:47 EDT 2013


On 17/6/2013 10:19 μμ, John Gordon wrote:
> 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.


#update file's counter if cookie does not exist
cur.execute('''UPDATE files SET hits = hits + 1, host = %s, lastvisit = 
%s WHERE url = %s''', (host, lastvisit, filename) )

if cur.rowcount:
		print( " database has been affected" )

indeed every time i select afilename the message gets printed bu then 
again noticing the database via phpmyadmin the filename counter is 
always remaining 0, and not added by +1

-- 
What is now proved was at first only imagined!



More information about the Python-list mailing list