CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   Pm system (http://www.codingforums.com/showthread.php?t=275124)

haseeb 10-04-2012 10:15 AM

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?

Fou-Lu 10-04-2012 03:27 PM

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.

haseeb 10-05-2012 12:46 PM

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?

Fou-Lu 10-05-2012 02:19 PM

Quote:

Originally Posted by haseeb (Post 1276497)
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.


All times are GMT +1. The time now is 01:28 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.