So, I have a class and from within a function in the class I am trying to call a global function, but I get the error message:
Fatal error: Call to undefined function ()
the line number the above function refers to is the line in which:
return get_session_user_id(session_id());
occurs on in the below class function
Class Ref {
function treat_var( $var , $table ) { global $link;
// do stuff
return get_session_user_id(session_id());
}
}
The treat_var function is a method in a class and is called by means of:
$ref = new Ref;
$ref->treat_var($var,$table);
The get_session_user_id function is a global function defined in an included in a file of functions and works just fine outside of the class and its code consists of:
// this function calls a USER_ID *IF one exists* from a session by using the session ID
function get_session_user_id($sessionID) { global $link;
$result = mysqli_query($link, "SELECT USER_ID AS ID from AAB_SESSIONS WHERE PHPSESSID = '$sessionID'");
$r = mysqli_fetch_object($result);
return $r->ID;
}
How do I call that function from within the class?
$emailAddresses = array_column($recipients, 'email');Error is:Call to undefined function MyPackage\array_column()