Welcome Guest, Not a member yet? Register   Sign In
Running Where Clause with Like Not Working
#6

This is bizarre whenever you are using "OR" in a query, it's the best approach to group your query in a manner to avoid conflict.
PHP Code:
$builder $db->table('contractors');
$builder->groupStart();
$builder->like('contractor_id'$inputText);
$builder->orLike('ccontact'$inputText);
$builder->groupEnd();
$builder->where('ccompanyId'$companyId); 

now your WHERE condition on companyId will be executed properly.
Learning Codeigniter 
Reply


Messages In This Thread
RE: Running Where Clause with Like Not Working - by SubrataJ - 04-18-2023, 08:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB