I am stuck. I can't find where is the flag for an unread message, or the counter in the notification. Etc.
I was able to find the messages a user has received with this query, but there is no field in which I can find whether they were read or still unread.
SELECT
u.id,
CONCAT (u.firstname,' ',u.lastname) AS name_of_student,
cvm.id,
FROM_UNIXTIME(me.timecreated),
me.subject,
me.fullmessage
FROM prefix_user AS u
JOIN prefix_message_conversation_members AS cvm ON cvm.userid = u.id
JOIN prefix_message_conversations AS cv ON cv.id = cvm.conversationid
JOIN prefix_messages AS me ON me.conversationid = cv.id
WHERE u.username LIKE :enter_username
AND me.useridfrom != u.id
ORDER BY me.timecreated DESC
Someone can help?
Thanks