Home  >  Article  >  Backend Development  >  函数代码详细求解解决办法

函数代码详细求解解决办法

WBOY
WBOYOriginal
2016-06-13 12:43:39721browse

函数代码详细求解
请高手帮忙详细解释下段代码
public function fetch_all_by_sql($where, $order = '', $start = 0, $limit = 0, $count = 0, $alias = '') 
{
$where = $where && !is_array($where) ? " WHERE $where" : '';
if(is_array($order)) {
$order = '';
}
if($count) {
return DB::result_first('SELECT count(*) FROM '.DB::table($this->_table).'  %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order));
}
return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order));
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn