I've been reading this post Creating a threaded private messaging system like facebook and gmail
It explains everything amazingly well but the queries don't work for me. I get an error at line 1 where it says "top 1" . :(
Here are the scenarios I'm trying to reach:
5 people are talking to member1. Member 1 and the other 5 members have threads, so that's 5 threads in total because there are 5 conversations. I need to fetch the latest reply from each of the 5 threads and the username of the person that left the last reply.
Once the message is open, show the replies.
I'm guessing the post that i was reading is efficient and will work well with thousands and hundred of thousands of threads/replies. If it'll be slow, let me know if anyone can point me to an article that does it correctly. I am not too good with MYSQL, still learning.
I am using this table setup