注意:未定义的偏移量:在第460行的D:\ Web \ www \ football \ admin \ players.php中为1
$query = mysqli_query($db_connect, "SELECT
team_season_names.SeasonName AS season_name,
team_seasons.SeasonID AS season_id
FROM team_season_names,team_seasons
WHERE team_seasons.SeasonID = team_season_names.SeasonID
AND team_seasons.SeasonPlayerID = '$player_id'
ORDER BY season_name
") or die(mysqli_error());
$all_seasons = mysqli_query($db_connect, "SELECT SeasonID FROM team_season_names") or die(mysqli_error());
$check_player = mysqli_num_rows($all_seasons);
mysqli_free_result($all_seasons);
$check_players = mysqli_num_rows($query);
$check_seasons = "";
while($data = mysqli_fetch_array($query)) {
echo "".$data['season_name']."<br>\n";
$check_season[] = $data['season_id'];
$check_seasons .= "<option value='".$data['season_id']."'>".$data['season_name']."</option>\n";
}
if ($check_player != $check_players) {
$i = 0;
echo "<br>Copy this Player to Season: <select name='copy_season'>";
$get_seasons = mysqli_query($db_connect, "SELECT * FROM team_season_names ORDER BY SeasonName") or die(mysqli_error());
while($data = mysqli_fetch_array($get_seasons)) {
if ($data['SeasonID'] != $check_season[$i]) { // Line 460
echo "<option value='".$data['SeasonID']."'>".$data['SeasonName']."</option>\n";
} else {
$i++;
}
}
mysqli_free_result($get_seasons);
echo "</select>\n";
echo "<input type='submit' name='copy_season_submit' value='Copy'><br><br>\n";
echo "You may Remove Player from Season: <select name='remove_season'>".$check_seasons."</select>\n";
echo "<input type='submit' name='remove_season_submit' value='Remove'>\n";
echo "<input type='hidden' name='player_id' value='".$player_id."'>\n";
echo "</form>\n";
} else if ($check_player == $check_players) {
echo "You may Remove Player from Season: <select name='remove_season'>".$check_seasons."</select>\n";
echo "<input type='submit' name='remove_season_submit' value='Remove'>\n";
echo "<input type='hidden' name='player_id' value='".$player_id."'>\n";
echo "</form>\n";
}
mysqli_free_result($query);
我已经准备好使用isset()和empty()并且他们得到了错误但是然后它向我展示了玩家的所有季节,而我只想得到玩家并没有全部准备好的季节另一件事只有当我为玩家选择一个赛季并且它是2015/16赛季的第一个赛季时,它才会向我显示这个错误