Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-04-2012, 10:15 AM   PM User | #1
haseeb
New Coder

 
Join Date: Apr 2012
Posts: 17
Thanks: 7
Thanked 0 Times in 0 Posts
haseeb is an unknown quantity at this point
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?
haseeb is offline   Reply With Quote
Old 10-04-2012, 03:27 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
Fou-Lu is offline   Reply With Quote
Old 10-05-2012, 12:46 PM   PM User | #3
haseeb
New Coder

 
Join Date: Apr 2012
Posts: 17
Thanks: 7
Thanked 0 Times in 0 Posts
haseeb is an unknown quantity at this point
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?
haseeb is offline   Reply With Quote
Old 10-05-2012, 02:19 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:00 PM.


Advertisement
Log in to turn off these ads.