1. Home
  2. Computing & Technology
  3. PHP / MySQL
photo of Angela Bradley
Angela's PHP / MySQL Blog

By Angela Bradley, About.com Guide to PHP / MySQL

A Unique ID

Monday May 15, 2006
I'm sure it's happened to you before: you sign up for a site and they generate you a unique user ID to use. One way to do this in PHP is to use the uniqid () function. This with generate a 13 or 23 character unique ID, which you can then add a prefix to if you desire. Once you send this to the user, you can then encrypt it and store it in the database.
Comments
May 16, 2006 at 2:47 pm
(1) Loretta says:

Wow, and I thought something like this would require a huge and complicated code. Amazingly easy :) thanks.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.