donglingsai2880 2017-06-07 06:16
浏览 319
已采纳

调用未定义的方法CI_DB_mysqli_driver ::和()

$q_cat_beauty = $this->db->select('*')->from('ms_categories')->where('source_id', 1)->and('category_name', 'Oral Care')->get();

i am trying to fetch the category name from my table.

  • 写回答

2条回答 默认 最新

  • dongpu1315 2017-06-07 06:18
    关注

    There is no and keyword or method in CI. If you want where with and condition you again have to write where

    $q_cat_beauty = $this->db->select('*')->from('ms_categories')
    ->where('source_id', 1)->where('category_name', 'Oral Care')->get();
    

    or use array in where

    $q_cat_beauty = $this->db->select('*')->from('ms_categories')
    ->where(array('source_id'=> 1,'category_name' => 'Oral Care'))->get();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?