Inbox Functionality with MYSQL
- by Faisal Abid
So I am writing a simple inbox private message system,
my table schema is as follows
- messageID
- message
- sender id
- receiver id
- date sent
- read ( 0 = no , 1 = yes)
now I am able to show the messages for the user by relating his userID to receiverID. However I also want to show the messages he has sent in the inbox to the user.
For example his inbox should show
Darth Vader - 3 New messages
Luke - 0 new messages (0 because either I read all of them OR i sent him the message and he has not replied).
But what i can only come up with is
Darth Vader - 3 New messages.
Can I get any help with how I can accomplish this SQL call?