prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$_SESSION['user_id']]); $user = $stmt->fetch(); $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; $error = ''; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $full_name = trim($_POST['full_name'] ?? ''); $bio = trim($_POST['bio'] ?? ''); $interests = trim($_POST['interests'] ?? ''); $investment_appetite = trim($_POST['investment_appetite'] ?? ''); if (empty($full_name)) { $error = "Name cannot be empty."; } else { $stmt = db()->prepare("UPDATE users SET full_name = ?, bio = ?, interests = ?, investment_appetite = ? WHERE id = ?"); try { $stmt->execute([$full_name, $bio, $interests, $investment_appetite, $_SESSION['user_id']]); $success = "Profile updated successfully!"; // Update session if name changed $_SESSION['full_name'] = $full_name; // Refresh user data $stmt = db()->prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$_SESSION['user_id']]); $user = $stmt->fetch(); } catch (PDOException $e) { $error = "Update failed: " . $e->getMessage(); } } } ?> Edit Profile — <?= htmlspecialchars($platformName) ?>
Back to Dashboard

Edit Profile

Manage your public presence in the community.

University status is verified and cannot be changed.