Wai*_*Yan 8 php mysql codeigniter
有人能告诉我如何用PHP加入3表吗?例
SELECT FROM table1, table2,table on INNERJOIN -------------------
Run Code Online (Sandbox Code Playgroud)
让我有3个表.(问题表,答案表和类别表)这是我的网页的示例.
Time remaining 30 minutes(I will get "30 minutes" form Category table)
1. Question (from question table)
2. answer (from answer table)
Run Code Online (Sandbox Code Playgroud)
我不知道如何加入3表.
小智 32
它应该是那样的,
$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();
Run Code Online (Sandbox Code Playgroud)
根据CodeIgniters活动记录框架
| 归档时间: |
|
| 查看次数: |
89064 次 |
| 最近记录: |