$result2 = mysql_query($query, $con);
while($data2 = mysql_fetch_assoc($result2))
{
$x = $data2["x"];
$y = $data2["y"];
echo "$x";
echo "$y";
if($x<0 && $y<0)
{
echo "village: $data[village] ";
echo "player: $data[player] ";
echo "position: ($data[x]|$data[y])<br>";
}
else if($x>0 && $y>0)
{
echo "village: $data[village] ";
echo "player: $data[player] ";
echo "position: ($data[x]|$data[y])<br>";
}
else if($x>0 && $y<0)
{
echo "village: $data[village] ";
echo "player: $data[player] ";
echo "position: ($data[x]|$data[y])<br>";
}
}
我收到错误
Notice: Undefined index: y in C:\xampp\htdocs\debal\nw_check_exec.php on line 48
Notice: Undefined index: x in C:\xampp\htdocs\debal\nw_check_exec.php on line 47
第 47 行和第 48 行是:-
$x = $data2["x"];
$y = $data2["y"];
我认为我已经正确地完成了所有事情,但我无法找出错误的原因。