'Fatal error: Call to undefined method mysqli_stmt::fetch_array() [duplicate]

in this code i get the error: Fatal error: Call to undefined method mysqli_stmt::fetch_array()

What is the problem?

$search= "player";

($sql = $db->prepare('select job from jobs where job like ?'));

$sql->bind_param('s', $search);
$sql->execute();
$sql->bind_result($search);

$data = array();

while ($sql->fetch_array(MYSQLI_ASSOC)) {
    $data[] = array(
            'label' => $row['job']  
    );
    echo json_encode($data);

}

$sql -> close();
$db -> close();

thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source