Welcome Guest, Not a member yet? Register   Sign In
Using a table name as a variable in Active Record Query
#2

[eluser]PhilTem[/eluser]
It must work. I got the same code running successfully on many pages Wink

But it also looks like you run the query but don't return the result (since you get an error with foreach not a MySQL-error). Do you have

Code:
function getAll($tbl)
{
  $query = $this->db->get($tbl);
  
  return $query->result();
}

in your code?


Messages In This Thread
Using a table name as a variable in Active Record Query - by El Forum - 07-15-2012, 07:32 AM
Using a table name as a variable in Active Record Query - by El Forum - 07-15-2012, 07:35 AM
Using a table name as a variable in Active Record Query - by El Forum - 07-15-2012, 07:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB