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手册中有误,不知大家遇到过类似的问题吗? 这是个错误,再下一版中将修复。 :)原来如此。 你这一句写错了吧?$this->db->select('url','name','clientid');
手册中是这样的:$this->db->select('url,name,clientid');
select只有两个参数,第一个是要查询的列;第二个参数是设置是否使用反引号保护你的字段名或者表名
详细请看:http://codeigniter.org.cn/user_guide/database/active_record.html#select 呵。。 楼主语法写错了。。。 楼上的对了。
页:
[1]