[eluser]Unknown[/eluser]
Hi,
Let's say I have the following code:
Code:
function getSomeVal(){
//using $this->db->where and get to retrieve and return some value from some table
}
//main query
$this->db->where('id', $id);
$this->db->update('mytable', array ('someVal'=>getSomeVal());
As you can see, during while building the main query, I'm calling a function which (to return a value) also builds a query.
I suppose this will not work, what's the solution to this problem? I may forget that the getSomeVal() function also uses db object...