Welcome Guest, Not a member yet? Register   Sign In
Help - me ! Sql - codeigniter
#1

[eluser]Junhinhow[/eluser]
Hi, I wonder how this code in Sql, works in CodeIgniter, I thank all who can help!

SELECT *
FROM equipamentos_splitter_cor WHERE NOT EXISTS(SELECT* FROM equipamentos_splitter_cor_cliente
WHERE equipamentos_splitter_cor_cliente.equipamentos_splitter_cor_id = equipamentos_splitter_cor.id AND
equipamentos_splitter_cor_cliente.equipamentos_splitter_id = 1)
#2

[eluser]ppwalks[/eluser]
Code:
$this->db->select('*');
$this->db->where_not_in('equipamentos_splitter_cor_cliente');
$this->db->where(' equipamentos_splitter_cor_cliente.equipamentos_splitter_cor_id','equipamentos_splitter_cor.id');
$this->db->where('equipamentos_splitter_cor_cliente.equipamentos_splitter_id', '1');
$query = $this->db->get('equipamentos_splitter_cor');

Something like that I think, its a bit rough to read though...
#3

[eluser]Junhinhow[/eluser]
the function "where not exists" of Mysql is the same as $this->db->where_not_in ???
#4

[eluser]ppwalks[/eluser]
Check this link out

http://ellislab.com/forums/viewthread/80477/#404387
#5

[eluser]Junhinhow[/eluser]
THANK YOU, HELPED ME ENOUGH




Theme © iAndrew 2016 - Forum software by © MyBB