Reputation: 11
i have this query but when the output displays its not sorted
function get_productbyid($productid) {
$this->db->select('*')->from('projquotedetails,products')
->where(array('projquotedetails.productid' => $productid))
->where('projquotedetails.productid = products.productid')
->order_by('page_order','asc')
;
$query = $this->db->get();
if ($query->num_rows() > 0) { return $query->result_array(); }
else { return 0; }
}
Upvotes: 0
Views: 46
Reputation: 375
Query ::
function get_productbyid($productid) {
$this->db->select('*')->from('projquotedetails,products')
->where(array('projquotedetails.productid' => $productid))
->where('projquotedetails.productid = products.productid')
->order_by('projquotedetails.page_order','asc')
;
$query = $this->db->get();
if ($query->num_rows() > 0) { return $query->result_array(); }
else { return 0; }
}
Upvotes: 1