错误就像标题一样,并且从SO中的各个帖子中提到了关于错误的服务器端。
我只是重复相同的PHP脚本,表名和列名不同。该脚本用于更新列,但只有一个列未更新 - bizPhone
,并删除了内容。其他专栏 - bizName
,bizAddress
等,没问题。
我比较了Config文件和PHP脚本中的字符串 - 没有区别。
原始PHP脚本:
$sql = "SELECT countryID FROM wg_countries WHERE country = '$country'";
$res = mysqli_query($con,$sql);
$result = array();
while($row = mysqli_fetch_array($res)){
$countryID = $row[0];
}
$sql2 = "SELECT categoryID FROM wg_categories WHERE category = '$category'";
$res2 = mysqli_query($con, $sql2);
$result2 = array();
while($row2 = mysqli_fetch_array($res2)){
$categoryID = $row2[0];
}
$sql3 = "UPDATE wg_groups SET groupName = '$groupName', description = '$description', countryID = '$countryID', categoryID = '$categoryID', url = '$url' WHERE groupID = '$groupID'";
if(mysqli_query($con,$sql3)){
echo "Successfully Updated";
}else{
echo "Could not update";
}
复制和修改的PHP脚本:
$sql = "SELECT countryID FROM wg_countries WHERE country = '$country'";
$res = mysqli_query($con,$sql);
$result = array();
while($row = mysqli_fetch_array($res)){
$countryID = $row[0];
}
$sql2 = "SELECT categoryID FROM wg_categories WHERE category = '$category'";
$res2 = mysqli_query($con, $sql2);
$result2 = array();
while($row2 = mysqli_fetch_array($res2)){
$categoryID = $row2[0];
}
$sql3 = "UPDATE wg_biz SET bizName = '$bizName', bizAddress = '$bizAddress', countryID = '$countryID', categoryID = '$categoryID', bizURL = '$bizURL', bizPhone = '$bizPhone' WHERE bizID = '$bizID'";
if(mysqli_query($con,$sql3)){
echo "Successfully Updated";
}else{
echo "Could not update";
}
由于我一直收到错误500,我已经检查了GoDaddy中的日志错误但没有详细信息 - 只有500 xx xx xx之类的东西。
此外,查询已经测试并且没有问题。我应该在哪里检查? :(
答案 0 :(得分:0)
500错误是服务器错误。不是android错误。你可以查看apache错误日志以查看错误。
如果从浏览器调用该脚本,会出现同样的错误吗?
调试是一步一步的。