谁能告诉我如何用 php 连接 3 个表? 示例
SELECT FROM table1, table2,table on INNERJOIN -------------------
让我有 3 个表。(问题表,答案表和类别表) 这是我的网页示例。
Time remaining 30 minutes(I will get "30 minutes" form Category table)
1. Question (from question table)
2. answer (from answer table)
我不知道如何加入 3 表。
最佳答案
应该是这样的
$this->db->select('*');
$this->db->from('table1');
$this->db->join('table2', 'table1.id = table2.id');
$this->db->join('table3', 'table1.id = table3.id');
$query = $this->db->get();
根据 CodeIgniters 事件记录框架
关于php - 如何使用 CodeIgniter INNER JOIN 3 个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7440371/