First create a new instance of the User class. Then use this instance to call your function and provide the $ uid parameter to make your request run like shoudl. If there is a match in your datatable, your Userobject will be populated with DB results.
Personally, I prefer to use static calls, which makes your code more readable and compact.
Difference:
$userObj = new User(); $user = $userObj->GetUserInfo('your uid');
or
$user = User::GetUserInfo('your uid');
And I see a strange } on line 4. Correct me if I am wrong, but I think it should be after } from the GetUserInfo($uid) function.
source share