
October 17th, 2012, 06:10 AM
|
|
Contributing User
|
|
Join Date: Oct 2010
Posts: 40
Time spent in forums: 8 h 48 m 23 sec
Reputation Power: 3
|
|
|
PHP query order by?
Hello
I have this code and now the table order by ASC
i wanted to order by (by default DESC)
private function _buildOrder($order){
$orderBy='';
if(is_array($order)){
foreach($order as $field=>$seq){
if(in_array(strtoupper($seq),array('ASC','DESC'))){
$orderBy=' ORDER BY '.$this->_esStr($field).' '.$this->_esStr($seq);
break;
}
}
}
return $orderBy;
}
thanks
|