I am working on a members database and I need to generate unique serial / code for each member.
The unique code must be in format of XXXX-XXXX-XXXX-XXXX-XXXX or something similar.

I can generate the code by one way or another usin chr() etc. but how do i make sure that its unique ?