Reputation: 11
I have a table with following fields:
I need sort based on another field:
if (sortbyp=1) {
sort by "published_date"
}
else {
sort by "created_date"
}
I need to pass this to a Zend App_Solarium. Like:
$sort = array('mysql_id' => 'desc');
Upvotes: 0
Views: 501
Reputation: 615
Use SQL order by method: http://www.w3schools.com/sql/sql_orderby.asp
Nothing else to say really.
Upvotes: 1