Welcome Guest, Not a member yet? Register   Sign In
Another MySQL question
#3

[eluser]codex[/eluser]
[quote author="Skulls" date="1199140084"]
Code:
$try_this_sql=" SELECT * from projects WHERE ((project_client_id=$this->session->userdata('uid')) OR (project_contractor_id=$this->session->userdata('uid') ))
AND (project_creator_id !=$this->session->userdata('uid')) ";
$query=$this->db->query($try_this_sql);
$result=$query->result();


use the brackets to group conditions .. where (color=red or color=green) and (color!=black)[/quote]

Yaay! Didn't know about/think of bracketing, but it makes perfect sense. Thanks!


Messages In This Thread
Another MySQL question - by El Forum - 12-31-2007, 10:03 AM
Another MySQL question - by El Forum - 12-31-2007, 10:28 AM
Another MySQL question - by El Forum - 12-31-2007, 10:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB