Ferrous Cranus <nikos.gr...@gmail.com> writes:

> I;am now convinced the hash solution isn't reversible and also isn't
> unique.

Great!

> how is the mysql statement is going to find the 'pin' to update the
> specific record.

The simplest way is to execute a SELECT just after the insertion, doing
a

  SELECT pin FROM counters WHERE page = %s

I don't use MySQL, so I can't say if it supports "INSERT ... RETURNING ..."
SQL syntax: should it, then you could insert the data and fetch
the pin in one shot, with something like

  INSERT INTO counters (page, hits) VALUES (%s, %s) RETURNING (pin)

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

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

Reply via email to