How can I duplicate the function of an auto incrementing Id field without ma开发者_开发问答king the field itself auto incrementing? I suppose on my INSERT statement, I would need to somehow grab the last id created, and add +1 on the new entry. But I don't know how. Any help is appreciated.
EDIT: I ended up taking ypercube's advice and keeping the id field as autoincrementing and making my searchstring unique. Thanks!
You'd need to select the highest current ID in one query, then use that when inserting using a second query.
To get round the race conditions, you could create a table lock (nasty) or use transactions (better, but not ideal)
精彩评论