Welcome Guest, Not a member yet? Register   Sign In
Dabase queries inside a static method
#1

[eluser]jwburnside[/eluser]
Hey all, I'm trying to run a query inside a static method, so I can ultimately create an array of objects. I haven't tried it before, but from what I can gather this is a pretty common way to do this. I can't seem to get that query to work though. I usually do this:

$query = $this->_db_model->get(self::NAME);
$result= $query->result();
return $result;

Which gives me an error since I can't use $this inside a static method. How do I accomplish it instead?

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB