Can CodeIgniter Helper Functions use database functions?

前端 未结 4 1009
不思量自难忘°
不思量自难忘° 2021-02-05 13:37

One of my CodeIgniter Controller functions needs to call a recursive function as part of its functionality. The function call chokes if I put it inside the controller class, an

4条回答
  •  天涯浪人
    2021-02-05 14:18

     //Select Data:
    
    $this->db->select(‘fieldname seperated by commas’);
    
    $this->db->from(‘table’);
    
    $query = $this->db->get();
    
    $results=$query->result() ;
    
    //Joins:
    
    $this->db->select(‘*’);
    $this->db->from(‘table1′);
    $this->db->join(‘table2′, ‘table2.id = table1.id’);
    
    $query = $this->db->get();
    

    We may get it from http://skillrow.com/codeignitor-database-functions/

提交回复
热议问题