几年前,我为我的一些移动应用程序创建了一个后端(PHP 来获取一些 json 数据)。从那时起我就没有碰过这段代码。现在它几周前就停止工作了。我不是后端开发人员,所以我在这里没有太多经验,但几年前我认为创建自己的后端而不是使用 Firebase/Serverless 会更好......这不是我最好的主意:)
我尝试了什么:
One moment, please...
Please wait while your request is being verified...
这是我的 php 文件:
$response = array();
function saveResultOfQueryToArray($result){
global $response;
$response['workouts'] = array();
while($row = mysqli_fetch_array($result)){
$temp = array();
// $temp['aufruf'] = $aufruf;
$temp['error'] = false;
$temp['workoutname'] = $row['workoutname'];
$temp['duration'] = $row['duration'];
...
array_push($response['workouts'],$temp);
}
}
if($_SERVER['REQUEST_METHOD']=='GET') {
$db = new DbOperation();
$users = $db->getHighestRatingWith31Results();
saveResultOfQueryToArray($users, $chooseMethod);
}
else {
$response['error'] = true;
$response['message'] = "Invalid Request";
}
echo json_encode($response);
有人可以向我解释一下我做错了什么/可以改变什么吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号