-2
我有一个简单的问题,但无法找到该错误。也许你可以帮忙。这里是我的要求:阿贾克斯请求无函数
$http({
url:'api/create_plane.php',
method: "POST",
data: {
planeKey: $scope.editKey,
planeSQLID: $scope.editSQLID,
planeLMID: $scope.editLMID,
planeAFID: $scope.editAFID,
planeVersion: $scope.editVersion,
planeLot: $scope.editLot,
planeStation: $scope.editStation
},
dataType: 'json'
}).success(function(data, status, headers, config) {
console.log(data);
}, function(response) {
console.log(response);
});
这是我的PHP文件:
$Planes = array();
$MAX_PLANES = 45;
if (empty($_POST['planeLMID'])) {
for ($i = 1;$i < $MAX_PLANES;$i++) {
if (checkSQL($i)) {
$Planes[$i] = new createPlane($i,$db);
}
}
echo json_encode($Planes);
}
else {
for ($i = 1;$i < $MAX_PLANES; $i++) {
if ($Planes[$i]['planeSQLID'] == $_POST['planeSQLID']) {
echo "HALLO";
}
}
}
但是我没有看到"Hallo"
在任何时间。我需要你的帮助。
在'else'情况下'$ Planes'是__empty__ –
前嗯,我来到了空面我收到的JSON编码的回声 – Kavkus
您收到'回声json'在另一个查询 –