Fatal error: Can't use function return value in write context in /home/gdcrpgin/public_html/manage_mypage.php on line 79
The complete web project was working fine until it was on my local windows machine since i uploaded this to online linux server (Hostgator) one of my page started showing this error I don't have any idea what this error mean i tried troubleshooting it at my level but nothing was achieved.
Line 79 is
<input type="text" name="home" class="form-control" maxlength="60" value = "<?php if(!empty(getuserfield($conn,"home"))) echo getuserfield($conn,"home") ?>" required>
Function getuserfield() return nothing more than "Fake" string. I commented out its actual work to see it helps or not but no luck.
function getuserfield($conn,$field)
{
/*
$table = $_SESSION['type'];
$key = $_SESSION['key'];
$user = $_SESSION['username'];
$query = "select $field from $table where $key = '$user'";
$query_run = mysqli_query($conn,$query) or die(mysqli_error($conn));
while($fetch = mysqli_fetch_array($query_run)){
if(!empty($fetch[0]))
return $fetch[0];
else
return null;
}*/
return "Fake";
}