<?php
include 'db.php';
$unique_id = $_GET['id'];
$sql = "SELECT title, content, created_at FROM posts WHERE unique_id='$unique_id'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<h1>" . $row["title"]. "</h1>";
echo "<p>" . $row["content"]. "</p>";
echo "<small>Paylaşıldı: " . $row["created_at"]. "</small>";
}
} else {
echo "Metin bulunamadı.";
}
$conn->close();
?>