codeIgniter use mysql_real_escape_string() instead.database connection issue

前端 未结 5 568
臣服心动
臣服心动 2021-01-06 04:52

I have code igniter installed on server with database I want to run the same db on my mac, I used MAMP and I copy the project folder inside htdocs, but I have this error wou

5条回答
  •  抹茶落季
    2021-01-06 05:27

    It's not goot idea edit core CI files. If you don't want see deprecated warnings from mysql_escape_string, to use mysql_real_escape_string() instead you need open connection with DB. Use db->initialise() in your base controller

    class Base_controller extends CI_Controller {
     function __construct() {
         parent::__construct();
    
        $this->load->database('db_name');
        $this->db->initialize();
    

提交回复
热议问题