Welcome Guest, Not a member yet? Register   Sign In
active query question
#1

[eluser]xeroblast[/eluser]
hello,

how can i use this query (SELECT * FROM `table1`,`table2` WHERE `table1`.`id`=`table2`.`table1_id` AND `table2`.`id`='my_value') using the active query?

thanx.
#2

[eluser]umefarooq[/eluser]
Code:
$this->db->select('*');
$this->db->from('table1');
$this->db->form('table2'); modified
$this->db->where('table1.id = table2.table1_id');
$this->db->where('table2.id',my_value);
$query = $this->db->get();
#3

[eluser]xeroblast[/eluser]
thanx for the reply...

do you think $this->db->from() can accommodate 2 tables?

i only use the $this->db->join() but cant accommodate the $this->db->where().
#4

[eluser]umefarooq[/eluser]
yes from can do but join is best option for tables to retrieve records between tables where you can use for specific record
#5

[eluser]xeroblast[/eluser]
thank you...
#6

[eluser]iron-man[/eluser]
You can use $this->db->join(); command




Theme © iAndrew 2016 - Forum software by © MyBB