我建立了一个使用5列的简单消息传递系统
---------------------------------------------------------------------------------
ID (INT) | toid (INT) | fromid (INT) | message (TEXT) | datetime (datetime stamp)
---------------------------------------------------------------------------------
并且我当前正在使用以下查询来显示登录用户的所有消息
SELECT m.fromid as messageid,
photo, forename, surname, m.status, datetime, m.type, message, timestamp
FROM messages m
LEFT JOIN users ON users.userID = m.fromid
WHERE toid ='106'
GROUP BY fromid
ORDER BY datetime DESC
目前,该查询仅在该人回复消息后才显示消息(这是由于WHERE toid = '106'
我想知道当用户ID'106'
发起对话时显示消息的正确查询是什么