prepared statement SELECT gives Call to a member function fetch_assoc() on a non-object
10:41 17 Jan 2016

I'm trying to fetch the database with a prepared statement, but I get an error:

Call to a member function fetch_assoc() on a non-object

What am I doing wrong?

$peopleID = $_GET['peopleID'];  
$stmt = $link->prepare("SELECT * FROM people WHERE peopleID = ?");
$stmt->bind_param('i', $peopleID);


$result = $stmt->execute();
$stmt->store_result();

if ($stmt->num_rows >= "1") { 
while($row = $result->fetch_assoc()) {
    $firstname = $row ['firstname'];
    $lastname = $row ['lastname'];
}
}
php mysqli prepared-statement