Click here to Skip to main content
15,896,278 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I am making a bot for Skype which will operate as a narrator to a huge zork-like text-based game.

In my "users" table, I have user_id and username and so forth, but this user_id is something I have generated myself. In the end, the username is always the one that I will have to use to find the user_id of a user since every message in the chat program can only give me the username of that person and not the user_id that I have invented myself.

This means that every time I want to modify a users data in a table I have to use the username to find the user's id, and I do this because the user_id is the only thing mentioned in many of my tables rather than the username.

My question is of course, should I skip all this user_id crap and just use the username?
Posted
Updated 3-Jun-11 7:26am
v3

1 solution

When the username is unique, you can use it as a key in your database. You won't be allowed to have a double username in your database.

But i don't think you wan't that.
 
Share this answer
 
Comments
Qvazzler 3-Jun-11 14:25pm    
Thanks, I'll start using the username. Makes more sense to me as well anyway.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900