$stmt2 = $conn->query("SELECT * FROM link WHERE id = ?");
$stmt2->bind_param('s', $id);
$stmt2->execute();
$row_cnt = mysqli_num_rows($stmt2);
if($row_cnt == 0) {
header('Location: http://example.com/doesntexist');
}
即使存在ID,这也行不通......我做错了什么?