用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3129|回复: 2
收起左侧

《PHP 敏捷开发框架 CodeIgniter》社区预览版(CTP),有错误

[复制链接]
发表于 2010-5-29 18:20:48 | 显示全部楼层 |阅读模式
4.3.2 “读取”查询中:
  $this->db->select('url','name','clientid');
  $query = $this->db->get('sites');

其中的select语句是错误的,应该是:
   
$this->db->select('url,name,clientid');具体可见源代码:/**

* Select

*

* Generates the SELECT portion of the query

*

* @access
public

* @param
string

* @return
object

*/

function select($select = '*', $escape = NULL)

{

// Set the global value if this was sepecified


if (is_bool($escape))

{

$this->_protect_identifiers = $escape;

}



if (is_string($select))

{

$select = explode(',', $select);

}


foreach ($select as $val)

{

$val = trim($val);


if ($val != '')

{

$this->ar_select[] = $val;


if ($this->ar_caching === TRUE)

{

$this->ar_cache_select[] = $val;

$this->ar_cache_exists[] = 'select';

}

}

}

return $this;

}


错别字的话还能忍下,但是代码错误就不能原谅了,希望下一版本的时候能改正过来。
 楼主| 发表于 2010-5-29 18:22:54 | 显示全部楼层
同样的,在4.3.2中的最后一句:
$this->db->select('url','name','clientid','people.surname AS client');
也是错误的......
发表于 2010-5-29 21:46:48 | 显示全部楼层
感谢提出问题,此问题已经记录,下次发布会更新,谢谢。

本版积分规则