In <kpne3k$1066$1...@news.ntua.gr> Simpleton <supp...@superhost.gr> writes:

> Hello again, something simple this time:

> After a user selects a file from the form, that sleection of his can be 
> found form reading the variable 'filename'

> If the filename already exists in to the database i want to update its 
> counter and that is what i'm trying to accomplish by:

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

> For some reason this never return any data, because for troubleshooting 
> i have tried:

> -----------------
> data = cur.fetchone()

> if data:
>       print("something been returned out of this"_
> ----------------

An UPDATE statement isn't a query.  There are no results to be fetched.
If you want to get results, execute a query (usually a SELECT.)

Also, that print statement is an obvious syntax error.  Please post
the actual code you're running; don't type it in from memory.

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

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to