View Full Version : Unique ID?


VMinder
02-28-2007, 07:26 PM
I'm not sure if this is possible with PHP and MySQL though I am sure it is. I am working on a member database and I want to assign each member a specific and unique ID number.

I don't want to do it manually if I have to, so I am wondering if anyone knows the line of coding I need to include inorder for the database to assign each member that is inserted into the database their own ID number.

I've been looking all over the place for the answer, but have not found it yet. Any help would be greatly appreciated.

Idiotic Creation
02-28-2007, 10:02 PM
Well, I think there is a setting you can apply to a field that will automatically do that, but I just wrote my own when I needed this.

Basically, I just made a field in my database that keeps track of the number of members. When a new member joins that number is updated. This way in your registration script you can call that number, and add one to it, then set it as that users ID. Don't forget to update the number afterwards.

I'm unsure of your PHP knowledge, so if you need help with the actualy script, then I'll be glad to assist you.

David

VMinder
03-01-2007, 01:38 AM
I'd very much appreciate some more help with the script. I am fairly new to PHP and don't know to much.

VMinder
03-01-2007, 03:52 AM
I figured it out. Thank you anyway!

Idiotic Creation
03-02-2007, 12:55 AM
Well, I'm glad you figured it out! :D


Just curious, how did you do it? Did you find the option to automatically auto-increment?
EDIT: --------------------------------------------------------^That wasn't redundant at all!
:)