谁能告诉我如何用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活动记录框架