You need a table for "Users" (which it sounds like you already have).Then you need a table for "Messages". When a user "Sends" another user a message you INSERT a row/record into the Message table.The message table will need columns/field for:Message ID (This could be IDENTITY type column which will auto-number 1,2,3,...)Created - Date/Time the record was createdSender User IDRecipient User IDSubject maybe?Message TextStatus - e.g. "New message", "Message has been read", "Message has been marked for deletion" - you may have other Status codes e.g. "Sender recalled the message", "Archive", etc.So when a user "sends" a new message they must choose the Recipient ID, and enter the Subject / Message text. You INSERT that as a new row with status= "NEW"When a user logs in you can show them their NEW messages:SELECT [Subject]FROM [Messages]WHERE [RecipientID] = @MyUserIDAND [Status] = 'NEW'ORDER BY [Created], [ID]
when they read a message you would do:SELECT [Subject], [Message]FROM [Messages]WHERE [RecipientID] = @MyUserIDAND [ID] = @MyMessageIDUPDATE [Messages]SET Status='READ'WHERE [RecipientID] = @MyUserIDAND [ID] = @MyMessageIDAND Status='NEW' -- NOTE: This will only actually update the row the first time the message is read, after that "0 rows" will be updated