0

如何将连接提示传递给 codeigniter?

我想运行以下 SQL 查询:

SELECT t1.a, t2.b FROM t1
INNER HASH JOIN t2 on t1.id = t2.id

如何使用 codeigniter 运行上述查询?您可以指定连接类型,但不能传入连接提示。

4

1 回答 1

-1
    you can simply load database library and use below code to exicute join query  

    $this->db->select('t1.a,t2.b');
    $this->db->from('t1');
    $this->db->join('t2', 't1.id = t2.id','INNER'); //You can use multiple joins same like this  
    //$this->db->where('t1.id','123'); // if required use where tag
    $query = $this->db->get()->result(); // $query conatin query result 
于 2018-09-06T07:13:19.080 回答