Answer the question
In order to leave comments, you need to log in
How to save user's messages with date in database?
So I ran into this dilemma:
I have users and they send messages. The message comes to the server, and it would seem that I just need to save it in some general list (log). But here the question arises: how can I save messages so that I can get a list of messages of a certain time interval ?
You answer: save them with a unix timestamp, and then just go through the entire list. But here another problem arises: how can I save messages so that I can get a list of messages from a specific user of a certain time interval ?
Please offer your ideas for data organization. What is the best way to save messages in each user, or save them in the general list? If I save them both there and there, then it will take up a lot of memory. I also need to get a general list of all messages .
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question