Welcome Guest, Not a member yet? Register   Sign In
Active record help
#1

[eluser]bradleyg[/eluser]
Been trying to work this out for a while... just can't get it.

Search param 1 will either be an email or username.
Search param 2 will be an array of regions (integers).

Code:
$param2 = array(2,3);
$this->db->where_in('region', $param2);
$this->db->where('username', $param1);
$this->db->or_where('email', $param1);

I'm not very good with mysql so excuse the incorrect syntax.

Code:
select * from table where username = $param1 OR email = $param1 AND region = 2 OR region = 3;

Any help?

Thanks


Messages In This Thread
Active record help - by El Forum - 08-10-2010, 11:22 AM
Active record help - by El Forum - 08-10-2010, 01:49 PM
Active record help - by El Forum - 08-19-2010, 02:09 AM
Active record help - by El Forum - 08-19-2010, 02:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB