Q: Properly formatted PHP function call failing I dread having to ask questions when I know the answer is going to be something very dumb, but here goes! I have 3 pages that I'm using. My edit_financials.php page is where I'm having the error. This page calls my config.php file, which intializes some site-wide stuff and instantiates the util.php page as util.
Other function calls to the same util.php work just fine, but for some reason, this one is causing everything to fail. 
I've isolated it to this one line:
$profileInfo = $util->getProfile();

Which calls the following function:
public function getProfile(){

$user = $this->getLoggedInUser();

$result = $this->DBQuery("SELECT firstname, middleinit, lastname, addr1, addr2, city, state, zip, email FROM user WHERE userId=$user");

if(!$result){
    return false;

} else {

    return $result;
}

return false;

}

The block of code on edit_financials.php is: 
$profileInfo = $util->getProfile();

while ($row = mysqli_fetch_array($profileInfo)){

        $firstname = $row['firstname'];
        $mi = $row['middleinit'];
        $lastname = $row['lastname'];
        $address1 = $row['addr1'];
        $address2 =$row['addr2'];
        $city =$row['city'];
        $state = $row['state'];
        $zip = $row['zip'];

}   

As you can see, I'm tryign to pass the result set back to edit_financials.php and then loop through it to get the values for my variables. I'm not even sure if I can do this, or maybe I should do the loop in util and pass back an array with all the values? 
I know the error has to be here somewhere, can anyone see what I'm doing wrong?
Update: 
I'm working on adding asserts (Learning something new today) in the meantime I added a couple more echos to see if it's even entering the function and it appears that it is not...
Added to edit_financials:
echo " About to call that pesky getProfile() function.... ";    

$profileInfo = $util->getProfile(); 

echo " We're back to edit_financials now... ";

Added to util:
    public function getProfile(){
echo " Function is running.... ";

// and I commented everything else out

}

And my output is: 
"About to call that pesky getProfile() function...."
And that's it. So it's not even entering the function, which is why I can't get a vardump.

A: Add assert "everywhere" to track it down. Good habit, anyway. Do you get an error message? If not, then you might want to get into more defensive programming.
Since getProfile can return false, it is not correct to use the result from that function without checking for false. Also, don't use !$result, but $result === null or similar.
For easier unit testing, getProfile() should be getProfile($userId).
As mentioned in the comments, getLoggedInUser() should be getLoggedInUserID().
Also, use prepared statements, always.
Enable all errors and warnings.
