PDA

View Full Version : Proper Database Structure that may support IM



joefazee
05-29-2008, 09:24 AM
I&#82*7;m planning a web application, but later the scripting may change, but I don&#82*7;t want the database structure to change, so for the start I want to get it right.

The application will later have an IM (instant messenger) just like Yahoo/MSN, so what is the proper way to store the user&#82*7;s information now.
Then later I will find I way of connecting to it.

Note: The registration form will contain: username,password,fullname,email&country

But if you have any knowledge of how is properly done, I will appreciate it.

I`m using MySql/PHP, But the IM will later be written in Python.
Please tell me what I need then I start making necessary arrangement towards it.

Thank you.
Abah

SyntaXmasteR
05-29-2008, 11:21 AM
Welcome to the forum Abah.

Well for starters I would structure your main (SERVER SIDE) database as followed:

TABLENAME: name_of_your_messenger
FIELDS: username, password, email, name, age, country, last_login, status

Status will be one of your most important fields to prevent multiple users from loggin into the same account.

If you plan to keep a history of chat logs you will need a second table Chat_Logs and will need to add a primary key for each user in your main name_of_your_messenger database. In the Chat_Logs database you would need the following fields: user_id, receiver_id, timestamp, message

For the client side registry keys I would use:
REGKEY: hkey_localmachine/software/name_of_your_messenger
REGKEY: hkey_localmachine/software/name_of_your_messenger/username

Under each username key I would have a password and port key.

I've never written an instant messenger system but if I were to try, this is the first structure that comes to mind.

xobomu
05-31-2008, 07:02 PM
xdddddd nice lol