0
は、ここに私のモデル関数はCodeIgniterの中にSQLの列の最大値に
public function bids_info($id){
$this->db->select_max('bid_amount');
$this->db->where('product_id', $id);
$result = $this->db->get('wc_bids');
$this->db->select('*')->select('wc_bids.id, wc_seller_products.id as p_id')
->from('wc_bids')
->join('wc_buyer', 'wc_bids.buyer_id = wc_buyer.id', 'LEFT')
->join('wc_seller_products', 'wc_bids.product_id = wc_seller_products.id', 'LEFT')
->where('wc_bids.bid_amount',$result);
$query = $this->db->get();
}
でどのように、私は私のproduct_idが22 ここでiが最大bid_amountを取得したいこの
のようなテーブルwc_bidsを持っていますモデル$ id = 22のように.... plsは適切なクエリを助けます...事前に感謝
使用select_max() - http://www.codeigniter.com/user_guide/database/query_builder.html – rad11
私は私uがそれを使用する方法 – Pardeep
frの動作していないselect_max理由を知りませんか?質問に追加してください – rad11