Answer the question
In order to leave comments, you need to log in
How to correctly display dialogs with the latest messages?
Hello everyone, I've been scratching my head for a long time how to implement. There are tickets, a kind of dialogue between the site admin and users, on the tickets page I need to display information about each dialogue that the user has and his last message, but only the first messages are displayed, what could be wrong? Broke my whole head.
SELECT tickets.*, ticketID.*, users.name
FROM
users, tickets, ticketID
WHERE
ticketID.ticketID = tickets.ticketID AND users.id = tickets.fromuser GROUP BY ticketID.ticketID ORDER BY tickets.id DESC
Answer the question
In order to leave comments, you need to log in
firstly, show the tables,
secondly, write the joins normally, then there will be no extra rows and without group buys
, thirdly, sorting should be done by date, not by id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question