2
在這段代碼我得到的錯誤:致命錯誤:調用未定義的方法mysqli_stmt :: fetch_array()致命錯誤:調用未定義的方法mysqli_stmt :: fetch_array()
問題是什麼?
$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();
感謝