CI2.11数据类型的怪异现象
以前用2.10的网站后台,升级到2.11后,里面的变量的类型不好使了,例如function edit($id=0,$lang_id=0){
....
$this->db->update('articles',$save,'id ='.$id);
会出现SQL错误(错误如下)
数据库错误发生 Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`=6`' at line 1
UPDATE `cms_articles` SET `title` = '联系我们' WHERE `id` `=6`
Filename: D:\xampp\htdocs\www\6083\system\database\DB_driver.php
Line Number: 330
where 后面的变量,整数型都被当成字符型加了引号 没事不要随便升级 CI 版本。
我还没有开始用 2.1.1 不太清楚原因。 只能这样写了
$this->db->where('id ',$id)->update('articles',$save);
我不得不赞自己是高手了。我用上最新版也是一名新手了{:soso_e113:}
2.11包里面的文件是6月12日的,我在实际应用中遇到了问题到官网发帖,有人回复说2.11的文件有误,已经更新。
官网文件的日期是6月13日的。
页:
[1]