Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Pm system

  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post

    Pm system

    Hi guys
    Currently i have done a registration system and a login system also and want to create a Private message system but iam confused about the process of it i mean how can i make it work.
    I have a database where one table is Users table and the other will be PM table how can i connect them i mean use together to run the private message system?

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    17,027
    Thanks
    4
    Thanked 2,668 Times in 2,637 Posts
    That's the easy part, it can be as simple as:
    Code:
    +-----------------------+
    | PrivateMessage        |
    +-----------------------+
    | fromUser [PK][FK]     |
    | toUser [PK][FK]       |
    | sentDateTime [PK]     |
    | message               |
    +-----------------------+
    Where fromUser and toUser are foreign keys to the user table. Then you simply select based on the current user. toUser would be in, and fromUser would be sent.

  3. #3
    New Coder
    Join Date
    Apr 2012
    Posts
    19
    Thanks
    8
    Thanked 1 Time in 1 Post
    Thanks but What it actually does a little bit more explaination ? Iam currently new to it.
    You are saying that fromuser and touser are foreign keys to the user table but to which column there?

  4. #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    17,027
    Thanks
    4
    Thanked 2,668 Times in 2,637 Posts
    Quote Originally Posted by haseeb View Post
    Thanks but What it actually does a little bit more explaination ? Iam currently new to it.
    You are saying that fromuser and touser are foreign keys to the user table but to which column there?
    Whatever your primary key is.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •