2013-03-21 75 views
2

我想这在codeigniter中交叉连接?

$this->db->join('tableTwo as b','','CROSS'); 
$result = $this->db->get('tableOne as a')->result(); 

一些解决方案?

+0

http://ellislab.com/codeigniter/user-guide/database/active_record.html – stormdrain 2013-03-21 16:59:57

+0

连接选项有:左侧,右侧,外侧,内侧,左侧外侧和右侧外侧。 – Maetschl 2013-03-21 17:06:50

+1

这很有趣。 – stormdrain 2013-03-21 17:26:27

回答

3

解决方案跨在笨加入:

$this->db->join('tableTwo as b','true'); 
$result = $this->db->get('tableOne as a')->result(); 
0

你应该使用这种方式:

$this->db->join('tableTwo as b','true'); 
$result = $this->db->get('tableOne as a')->result();