Page 1 of 1

Need help please.

Posted: Sun Jul 01, 2007 3:05 am
by tapas_bahirbag
how can i generate random alphanumeric code of length 5 and must be unique every time?

please help me.

Thanks,
Tapos Pal

Posted: Sun Jul 01, 2007 3:11 am
by Benjamin
You can generate a random alpha numeric string and store it in a database once it has been used.

Posted: Sun Jul 01, 2007 3:15 am
by tapas_bahirbag
but, i dont want to check database for uniqueness.

Posted: Sun Jul 01, 2007 3:34 am
by miro_igov
Then save all used codes in a file and read it each time before to issue new code :) No other way for uniqueness.

Posted: Sun Jul 01, 2007 5:15 am
by califdon
And please use a descriptive Subject for any future posts. Subjects like "Help!" are usually ignored by most of us.

Posted: Sun Jul 01, 2007 6:08 am
by superdezign
tapas_bahirbag wrote:but, i dont want to check database for uniqueness.
So what? If you want it to be unique as according the database, you have to use the database for it.

Posted: Sun Jul 01, 2007 7:32 am
by tapas_bahirbag
thanks for reply. my code is now running. i use database for uniqueness.


Regards,
Tapos Pal