Jan K. van Dalen
|
Posted: 05/07/2008, 9:41 PM |
|
Hi Everyone,
Any recomendations on how to default the value of a session variable with an
unique numeric value?
IOW, when the user opens the site, I want to assign a value to a Session
Variable that will have a unique numeric value that has not been used before
nor will be use again for all users.
Any ideas?
Thanks.
|
|
|
wkempees
Posts: 1679
|
Posted: 05/08/2008, 4:07 AM |
|
One way is to create a table in your database, Unique Autonum Key ID.
Sort of like a sequence_table.
I have to dig my memory banks, but I remember having a table with just one record allowed, could be that was in my Oracle days though.
At application session start, insert a record, retreive the last_inserted_id and use that.
Another way is to google for unique numbers using the atomic clock (lol), or
any value constructed from the date like strtotime() + sessionid.
Just my 2ct
Greetz, Jan
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
|
|
|