mysql solution

Lele Gaifax lele at metapensiero.it
Thu Jan 24 14:37:24 CET 2013


Ferrous Cranus <nikos.gr33k at gmail.com> writes:

> The following statement fails.
>
> [code]
> cursor.execute( '''INSERT INTO counters(page, hits) VALUES(%s, %s) RETURNING (pin) 
>                         ON DUPLICATE KEY UPDATE hits = hits + 1''', (htmlpage, 1) )
> [/code] 

How? What's the error message/traceback?

If, as Chris said, MySQL does not support the “RETURNING” syntax, you
cannot use that. I gave two different solutions in my previous message,
did you try the “simplest” one?

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.




More information about the Python-list mailing list