Welcome Guest, Not a member yet? Register   Sign In
ErrorException Trying to access array offset on value of type null
#4

(This post was last modified: 09-10-2020, 12:38 PM by Omar Crespo.)

You just missed the parameter, the correct function should be:

public function getAccess($menu)
{
$queryMenu = $this->getIdMenu($menu);
$id_menu = $queryMenu['id_user_menu'];
}

Also check 1 more thing:

Be sure that you are returning a valid value from getIdMenu($menu) function. For this sake, you have exceptions or a more simple way, a condition. Something like this:

public function getIdMenu($menu){

Here goes the code before this part

$variable = this->db->get();

$result = $variable->row_array();

if(!empty($result['id_user_menu']))

return $result;

return FALSE;

}
Reply


Messages In This Thread
RE: ErrorException Trying to access array offset on value of type null - by Omar Crespo - 09-10-2020, 09:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB