I have a player page that is used to show the players stats for career and basic personal info
now the page loads when the player is on a team and has a teamid associated with it
this error i get below is linked to the same page but is not on a team or have a teamid yet as they are waiting to be drafted by the team. I am looking for a way to display the page and get rid of the error.
here is the error
Fatal error: Call to a member function fetch_assoc() on a non-object in /hermes/bosoraweb061/b2495/ipg.msnhockeycom/ufhl/models/PlayerModel.php on line 36
here is the code at that line
public function setTeamInfo(){
$result = $this->mysqli->query("select * from teams where id=" . $this->player['teamid']);
if ($row = $result->fetch_assoc()) { [B][COLOR="#FF0000"] <------------line 36[/COLOR][/B]
$this->team=$row;
}
}
I have tried
if(!result) {
}