• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.