PHP/MySQL Experts : How to Generate a Unique Sequence of Numbers?
I want a way to create a sequence of 32-bit tokens that does not repeat and must be guaranteed unique across different sessions.
Preferably pseudo-random but sequential would be OK too.
Although MySQL does not support sequences one possible way is to create a table with an auto_increment column and for a new token insert NULL and then read back last_insert_id, but I would prefer to avoid an extra database write per session.
Any other ideas?
The tokens must be 32-bits long and the method work consistently on 32/64-bit servers without requiring any extensions or privileges beyond a typical default hosting account.
I'm beginning to think the above method may be the only way and would be interested in the thoughts of some more experienced PHP/MySQL developers.
Cheers,
Phil
Trippy Wire Content Exchage Network
Trippy Wire is looking for partners in these niches niches: Humor, Movies, Gaming, Celebrities, Entertainment, Sports, Food & Drinks, Hot Women, Technology & Transportation.
Trippy Wire Content Exchage Network
Trippy Wire is looking for partners in these niches niches: Humor, Movies, Gaming, Celebrities, Entertainment, Sports, Food & Drinks, Hot Women, Technology & Transportation.
Discover The Software That Creates Multiple Income Hybrid Affiliate Stores To Make
$500/Day... ON COMPLETE AUTOPILOT!