查询的时候 where和order条件不起作用,查看了源代码,发现 Db.class.php类的parseSql()方法在生产sql语句的时候,用的是 str_replace(
array('%TABLE%','%DISTINCT%','%FIELD%','%JOIN%','%WHERE%','%GROUP%','%HAVING%','%ORDER%','%LIMIT%','%UNION%','%COMMENT%'),...进行替换,可是select()方法中,没有where条件,所以就无法替换,改成$sql = "select " .
$this->parseDistinct(isset($options['distinct'])?$options['distinct']:false) .
$this->parseLimit(!empty($options['limit'])?$options['limit']:'') .
$this->parseField(!empty($options['field'])?$options['field']:'*') .
" from" ...这种方式就行了。
请问是bug问题还是我用的不对阿?
最佳答案