bingshao 发表于 2009-7-15 11:39:03

CI Active Record 类操作问题

使用CI的Active Record 类查询数据,$this->db->select('url','name','clientid');这是获得特定的列,不过在使用中却频繁出现错误
A PHP Error was encounteredSeverity: Notice
Message:Undefined property: stdClass::$title
Filename: curd/index.php
Line Number: 10

改成$this->db->select(array('url','name','clientid'
));可以正常使用,我想可能是
PHP敏捷开发框架COdeIgniter手册中有误,不知大家遇到过类似的问题吗?

Hex 发表于 2009-7-15 11:47:18

这是个错误,再下一版中将修复。

bingshao 发表于 2009-7-15 12:01:52

:)原来如此。

haohailuo 发表于 2009-7-16 10:38:05

你这一句写错了吧?$this->db->select('url','name','clientid');
手册中是这样的:$this->db->select('url,name,clientid');
select只有两个参数,第一个是要查询的列;第二个参数是设置是否使用反引号保护你的字段名或者表名

详细请看:http://codeigniter.org.cn/user_guide/database/active_record.html#select

avinmo 发表于 2009-7-19 11:33:29

呵。。 楼主语法写错了。。。 楼上的对了。
页: [1]
查看完整版本: CI Active Record 类操作问题