0

I am developing a website and i am always cautious about the security. Working with mysql database using the prepare statement is a good choice to protect against sql injection. I am new to codeigniter and right now i am on 2.1.4 version. Which is the latest one. I could not get any information about the usage of mysqli extension with my framework. I would appreciate if someone helps me. Thanks.

4

1 回答 1

1

取自这篇文章,您可以安装驱动程序以使用 MySQLi 语法:

Codeigniter 包含一个用于 mysqli 的数据库驱动程序,可以在 system/application/config/database.php 中设置为:

$db['default']['dbdriver'] = "mysqli";

但是,有一些限制。从我读过的各种来源(例如this)来看,执行多个查询或准备好的语句似乎是不可能的。使用 MySQLi 语法仍然可以获得一些好处,但绝对不能充分利用 MySQLi 的功能。

于 2013-11-13T16:38:09.403 回答