prepare("INSERT INTO posts (user_id, title, content) VALUES (?, ?, ?)"); $stmt->execute([$_SESSION['user_id'], $title, $content]); header("Location: community.php"); exit; } catch (PDOException $e) { $errors[] = "Database error: " . $e->getMessage(); } } } ?>