问题描述
我正在将CodeIgniter框架版本2.2与Oracle 11g数据库一起使用.
I am using CodeIgniter framework version 2.2 with Oracle 11g database.
在database.php中,我的配置如下:
In database.php my config looks like this:
与CodeIgniter的数据库连接良好.当我尝试使用CodeIgniter的ActiveRecord将简单记录插入数据库时,会出现问题.在查询的表名和列名中添加了双引号.因此,我收到此错误:
The database connectivity with the CodeIgniter is fine. The problem occurs when I try to insert a simple record to database using ActiveRecord of CodeIgniter. Double quotes are getting added to the tablename and column names in the query. Hence I get this error:
我的控制器:
和型号:
当我尝试不使用insert()函数直接插入数据时,数据将被添加到数据库中:
When I try to insert data directly without insert() function, the data gets added to the database:
但是我需要使用ActiveRecord的insert方法.
But I need to use the ActiveRecord's insert method.
如何消除双引号?
推荐答案
已解决!问题出在我下载的CI版本中.我使用了最新的稳定版2.2,然后根据以下链接修改了 oci8_driver.php : CodeIgniter-ActiveRecords和Oracle-配置
SOLVED! The problem was in the version of CI I had downloaded. I used the latest stable version 2.2 and then modified the oci8_driver.php according to this link : CodeIgniter - ActiveRecords and Oracle - configuration
这篇关于CodeIgniter和Oracle数据库-ActiveRecord insert()在查询中添加双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!