Codeigniter join query multiple conditions don't work

前端 未结 6 1265
温柔的废话
温柔的废话 2021-01-14 11:12

I want to select data from my database table with join query, but my it doesn\'t work.

My query:

$this->db->select();
$this->db->from(\'w         


        
6条回答
  •  隐瞒了意图╮
    2021-01-14 11:28

    $this->db->query('select we_tbl.c_name from we we_tbl,schedule sch_tbl where sch_tbl.itemid = we_tbl.cid AND we_tbl.idActive = '.$activeData);
    

    Try this query according to your problem this could get the data you need. I've tested on different database but i tried to perform what you're trying to get. https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in

    select 
    pro_tbl.ProductName, 
    cat_tbl.CategoryName ,
    sup_tbl.SupplierName 
    from 
    Products pro_tbl, 
    Suppliers sup_tbl,
    Categories cat_tbl 
    where  
    pro_tbl.SupplierID = sup_tbl.SupplierID AND
    pro_tbl.CategoryID = cat_tbl.CategoryID;
    

提交回复
热议问题