"Failture", "message" => "Database Connection Failed"]); return; } $jsonData =file_get_contents("php://input"); $data=json_decode($jsonData,true); if ($data === null) { http_response_code(400); // 回傳錯誤碼 400 Bad Request echo json_encode(["status" => "Failture","error" => "Invalid JSON"]); exit(); } // 取得POST傳入資料並進行防 SQL 注入處理 $Product_Key = CheckSQLCmd($data['Product_Key']); $sql = "SELECT MainUI,AsclepiusAI,Asclepius_Intelligence,Anatomy,Animal,Embryology,CTRender,Radiology,Histopathology,Kinesiology FROM `Asclepius_Product_Data` A LEFT JOIN `Asclepius_Special_Edition` B ON A.PID = B.PID WHERE A.Product_Key = ? "; // 參數順序依照 SELECT 子句中的順序,最後一個參數為產品金鑰 $params = [ $Product_Key ]; $success = $mysql->sql_execute($sql, $params); $result=$mysql->sql_fetchAll_mode(PDO::FETCH_ASSOC); // 回傳JSON訊息給客戶端 header('Content-Type: application/json'); echo json_encode(["status" => "success", "message" => "Special Edition is download successfully","result"=> $result]); ?>