if ($Funct == "BUILD" AND $Mode == "GROUND")
{
$sql = "SELECT * FROM $landCon WHERE North = '" . $North . "' AND West = '" . $West ."'" ;
$result = mysql_query($sql) or die("Error occurred in [$sql]: " . mysql_error());
$count = mysql_num_rows($result);
If ($Count == 0 )
{
$sql = "INSERT INTO $landCon (West,North,Type1) VALUES ($West,$North,'$Char')";
mysql_query($sql) or die("Error occurred in RootA as:[$sql]: " . mysql_error());
}
else
{
$result=mysql_query("UPDATE $landCon SET Type1= '$Char' WHERE North = $North AND West=$West") or die( "Database Error: ".mysql_error());
}
echo "SUCCESS";
}
而不是更新条目存在的位置,它正在插入。我的意图是,如果已经指定了$North
和$South
条目,则更新它,以便每个地图网格只有一个北/南值。
答案 0 :(得分:6)
$count = mysql_num_rows($result);
If ($Count == 0 )
$count
$Count
?
验证码:在您输入拼写错误时静默初始化新变量的语言