CodeIgniter: How to use WHERE clause and OR clause

前端 未结 6 1022
误落风尘
误落风尘 2021-01-03 19:23

I am using the following code to select from a MySQL database with a Code Igniter webapp:

$query = $this->db->get_where(\'mytable\',array(\'id\'=>10         


        
6条回答
  •  醉话见心
    2021-01-03 20:11

    Active record method or_where is to be used:

    $this->db->select("*")
    ->from("table_name")
    ->where("first", $first)
    ->or_where("second", $second);
    

提交回复
热议问题