4
I have a table. In her the 4 columns
ID
high-increment,
id_user1
would be the id of the user who sent the message,
id_user2
either would be the id of the user who received and
mensagem
the one who receives the message sent by id_user1
for id_user2
.
Is there any way to search the latest for a mailing list?
I mean, we have the Whatsapp and several other applications that follow the same message list system, where they go up according to the latest.
I know you can do it with a DESC
, but wanted something dynamic that shows up in real time and that was separated by ide as the applications and not ID 1 now and then ID 1 again in 4 or 5 and etc... each one separate and without showing the same id_user1
again..
They understood?
Add a field to your table with the upload date. Then
checarPorNovasMensagens.php
place an argument stating the last time a message was received. At the time of givingselect
Simply select all messages whose sending time is later than the last received message. Alternatively, you can select the last time the message was sent to a field in your user table.– Olimon F.
I advise to use UTC and convert Timezone later, to prevent headaches!
– Olimon F.
but "order by data desc" would only be a filter to sort the records in descending chronological order, so that within each record you can implement it in any way, containing or not information like ID and the like.
– Paulo Roberto Rosa
I don’t know anything, but explains one thing, how does p/ my whattssap appear "fucking..." instead of writing.... kkkkkkk
– SneepS NinjA