how to avoid sql injection in codeigniter

前端 未结 6 1992

In CodeIgniter, how can I avoid sql injection? Is there any method to set in config file to avoid sql injection? I am using this code for selecting values:



        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 20:08

    you can use

    $this->db->escape()
    

    method..

    $sql = "INSERT INTO table (title) VALUES(".$this->db->escape($omgomg).")";
    

    other methods are listed here.

    http://codeigniter.com/user_guide/database/queries.html

提交回复
热议问题