Steve Holden <sholden at holdenweb.com> wrote: : "Jacek Pop³awski" <jp at ulgo.koti.com.pl> wrote in message : news:slrn9eckbh.2f7.jp at localhost.localdomain... :> id_producenta is primary key (int) for table producent :> I need to find unique value for it, I use that code: <snip!> : Of course, you will realise that problems might arise should any two users : concurrently try to use any such routine, since NySQL (as far as I remember) : does not support transactions. It might be better to simply use MySQL's "auto_increment" tag for the key column. That way, one can simply use "0" as the ID number and MySQL will automatically generate a new, unique ID. Of course, if you need to return that same ID again for other purposes, you'll need the max() function along with some table locking before and aftwarwards (to keep the process atomic).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4