我试图从三个表中加载数据。然而,它只显示了第一行。寻求关于如何使其他行显示的建议:
MySQL表:
通知: col(to_interview):64,64,64
评论: col(interview_id):64,64,64 col(body):我爱她,我爱他,我两者都爱
专访: col(interview_id):64
PHP和MYSQL代码:
$data['notification']=$this->db->query
("SELECT n.*, i.*, c.*
FROM notification as n
INNER JOIN interview as i on n.to_interview = i.interview_id
INNER JOIN comment as c on n.to_interview = c.interview_id
WHERE n.to_interview='$interview_id'
GROUP BY n.to_interview
DESC");但是,我只从notification和注释获得了第一行结果,尽管有3行与interview_id 64相对应。
我们非常感谢你的建议。
最好的
发布于 2014-02-08 05:41:29
移除这个
GROUP BY n.to_interview DESC按用法分组只将搜索查询限制在第一行。
https://stackoverflow.com/questions/21642328
复制相似问题