prepare($sql); if (!$stmt) { die('预处理语句失败: ' . $conn->error); } $stmt->bind_param($paramTypes, ...$params); if (!$stmt->execute()) { die('执行语句失败: ' . $stmt->error); } $result = $stmt->get_result(); } else { $result = $conn->query($sql); if (!$result) { die('查询失败: ' . $conn->error); } } $tagResult = $conn->query("SELECT id, name FROM tags ORDER BY name"); ?> 应用标签

应用标签

query("SELECT id, name FROM tags ORDER BY name"); ?> fetch_assoc()): ?>
num_rows > 0): ?> fetch_assoc()): ?>

...

prepare($tagSql); $tagStmt->bind_param('i', $row['id']); $tagStmt->execute(); $tagResult = $tagStmt->get_result(); $tags = []; while ($tag = $tagResult->fetch_assoc()) { $tags[] = htmlspecialchars($tag['name']); } $tagStmt->close(); // 获取应用适用平台 $platforms = json_decode($row['platforms'], true); echo ' 标签: '. implode(', ', $tags) . '
'; $platforms = $platforms ?? []; echo ' 平台: '; foreach ($platforms as $platform) { $icon = ''; if ($platform === 'Windows') { $icon = ''; } elseif ($platform === 'macOS') { $icon = ''; } elseif ($platform === 'Linux') { $icon = ''; } elseif ($platform === 'iOS') { $icon = ''; } elseif ($platform === 'Android') { $icon = ''; } echo " $icon $platform"; } echo '
'; echo ' 评分: '. round($row['avg_rating'], 1) . '/5
'; echo ''; ?> 查看详情

未找到相关应用。