我发现什么是错的。在第一次会议之后发生了一些事情。
'SELECT m1.id, m1.title, m1.timestamp, count(m2.id) AS reps, users.id AS userid, users.username FROM pm AS m1, pm AS m2,users WHERE ((m1.user1="'.$_SESSION['user'].'" AND m1.user1read="no" AND users.id=m1.user2) OR (m1.user2="'.$_SESSION['user'].'" AND m1.user2read="no" users.id=m1.user1)) AND m1.id2="1" AND m2.id=m1.id group by m1.id ORDER BY m1.id DESC');
答案 0 :(得分:0)
'SELECT m1.id, m1.title, m1.timestamp, count(m2.id) AS reps, users.id AS
(
(m1.user1="'.$_SESSION['user'].'" AND m1.user1read="no" AND users.id=m1.user2)
OR
(m1.user2="'.$_SESSION['user'].'" AND m1.user2read="no" users.id=m1.user1)
)
AND m1.id2="1" AND m2.id=m1.id group by m1.id ORDER BY m1.id DESC');