Welcome Guest, Not a member yet? Register   Sign In
$this->db->bracket('close') gives error
#1

[eluser]Volkof[/eluser]
Hi guys,

I'm trying to insert brackets into Active Record so that my statement will execute properly. Following code is just part of the WHERE LIKE clause.:

Code:
$this->db->where("('moduleName' LIKE '%".$query_array['nameCode']."%'
   OR 'moduleCode' LIKE '%".$query_array['nameCode']."%'");
   $this->db->bracket('close');

Which should translate to (ignore the dummy values I added):
Code:
WHERE (moduleName LIKE "%?%" OR moduleCode LIKE "%?%" ) AND.......

However CI kept giving me this error:
Code:
Fatal error: Call to undefined method CI_DB_mysql_driver::bracket() in D:\Hosting\7009930\html\application\models\search_model.php on line 30

line 30 is $this->db->bracket('close');

Can anybody tell me why is this error happening? And if this does not work, how can I insert Brackets into Active Records?

Thank you
#2

[eluser]Aken[/eluser]
There is no bracket() method for active record, not sure where you thought there was.

Here are your options.




Theme © iAndrew 2016 - Forum software by © MyBB