04-12-2021, 02:57 AM
Hello,
i cant understand how pass data from controller to model query builder for example
i want get one contact card view by query builder where('id', $findid) how pass $findid variable?
or i should this done in controller?
and second question this below as example written is query builder example or not? If yes why no connection to DB and its working?
i cant understand how pass data from controller to model query builder for example
i want get one contact card view by query builder where('id', $findid) how pass $findid variable?
or i should this done in controller?
and second question this below as example written is query builder example or not? If yes why no connection to DB and its working?
PHP Code:
public function getNews($id = false)
{
if ($id === false)
{
return $this->findAll();
}
return $this->asArray()
->where()
->first();
}