我需要从成员表中选择 2 行来获取名称和 ID,并且我需要从消息表中获取所有行。到目前为止,这是我所拥有的任何提示或帮助,我们将不胜感激 EDIT Tables
SELECT member_messages.message_to,
member_messages.message_from,
member_messages.message_time,
member_messages.message_body,
members.display_name,members.id
FROM members
INNER JOIN member_messages
ON member_messages.message_to = members.id AS 'to'
INNER JOIN member_messages
ON member_messages.message_from = members.id AS 'from'
WHERE member_messages.message_to = '$userId'