Can CodeIgniter Helper Functions use database functions?

前端 未结 4 943
不思量自难忘°
不思量自难忘° 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条回答
  •  猫巷女王i
    2021-02-05 14:33

    You can get instance:

     $CI =& get_instance();
    

    After that you will be able to use $CI->db for queries..

提交回复
热议问题