Welcome Guest, Not a member yet? Register   Sign In
Creating Active Record Query
#2

[eluser]Karman de Lange[/eluser]
try
Code:
$this->db->select($this->titles_table.'.title_name');
$this->db->select($this->roster_table.'.condender_no');

$this->db->select($this->roster_table.'.roster_name');
        $sl = "CASE WHEN $this->title_champions_table.contender_no = 0 THEN 'Champion' ELSE 'Contender' END as champion"
$this->db->select($sl,false);

$this->db->from($this->titles_table);
$this->db->join($this->roster_table, $this->titles_table.'.roster_id ='. $this->roster_table.'.id', 'inner');
$this->db->join($this->title_champions_table, $this->titles_table.'.id ='. $this->title_champions_table.'.title_id', 'inner');
      
$query = $this->db->get();


just make sure you escape all correctley as the false sayd don't escape.

L:


Messages In This Thread
Creating Active Record Query - by El Forum - 06-20-2012, 10:17 AM
Creating Active Record Query - by El Forum - 06-20-2012, 02:20 PM
Creating Active Record Query - by El Forum - 06-20-2012, 02:53 PM
Creating Active Record Query - by El Forum - 06-20-2012, 02:57 PM
Creating Active Record Query - by El Forum - 06-21-2012, 09:11 AM
Creating Active Record Query - by El Forum - 06-21-2012, 11:03 AM
Creating Active Record Query - by El Forum - 06-21-2012, 11:04 AM
Creating Active Record Query - by El Forum - 06-21-2012, 02:39 PM
Creating Active Record Query - by El Forum - 06-22-2012, 10:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB