How do you make an ID in mysql?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Gladiator
Forum Newbie
Posts: 5
Joined: Sat Jun 15, 2002 4:35 pm

How do you make an ID in mysql?

Post by Gladiator »

How do you insert an ID to a table for multiple users? Please tell me =]
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

What do you mean exactly? Are you trying to insert an ID column into a table of user information?

Mac
Gladiator
Forum Newbie
Posts: 5
Joined: Sat Jun 15, 2002 4:35 pm

Post by Gladiator »

Its on one of the tutorials on the site but it doesn't say how to do it.
Gladiator
Forum Newbie
Posts: 5
Joined: Sat Jun 15, 2002 4:35 pm

Post by Gladiator »

User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Are you trying to add an ID column to a table that already exists or a new one?

Mac
Gladiator
Forum Newbie
Posts: 5
Joined: Sat Jun 15, 2002 4:35 pm

Post by Gladiator »

new one
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Basically all you have to do is when you are creating your new table is call one of the columns something like 'ID', make it the primary key and make it an auto-incrementing field.

If you're not sure how to create a table there's this that'll be helpful:
http://newbienetwork.net/content.php?id=10

Mac
Gladiator
Forum Newbie
Posts: 5
Joined: Sat Jun 15, 2002 4:35 pm

Post by Gladiator »

alright thxs man
Post Reply