connect_error) { die("数据库连接失败: " . $conn->connect_error); } // 查询最新的 app 列表,按发布时间降序排列 $sql = "SELECT * FROM apps ORDER BY created_at DESC LIMIT 20"; $result = $conn->query($sql); // 获取当前时间 $now = date('c'); // 生成 Atom 内容 $atom = " 最新 App 列表 leonmmcoset.jjmm.ink:3232 " . $now . " http://leonmmcoset.jjmm.ink:3232 管理员 "; if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $atom .= " " . htmlspecialchars($row['name']) . " http://leonmmcoset.jjmm.ink:3232/app.php?id=" . $row['id'] . " " . date('c', strtotime($row['created_at'])) . " " . htmlspecialchars($row['description']) . " "; } } $atom .= ""; // 输出 Atom 内容 print $atom; // 关闭数据库连接 $conn->close();