prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$user_id]); $user = $stmt->fetch(); if (!$user) { header('Location: login.php'); exit; } $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; $error = ''; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (isset($_POST['action']) && $_POST['action'] === 'update_profile') { $full_name = trim($_POST['full_name']); $bio = trim($_POST['bio']); $university = trim($_POST['university']); $degree_program = trim($_POST['degree_program']); $skills = trim($_POST['skills']); $startup_industries = trim($_POST['startup_industries']); if ($full_name) { $stmt = db()->prepare("UPDATE users SET full_name = ?, bio = ?, university = ?, degree_program = ?, skills = ?, startup_industries = ? WHERE id = ?"); $stmt->execute([$full_name, $bio, $university, $degree_program, $skills, $startup_industries, $user_id]); $success = "Profile updated successfully!"; // Refresh user data $stmt = db()->prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$user_id]); $user = $stmt->fetch(); } else { $error = "Full name is required."; } } elseif (isset($_POST['action']) && $_POST['action'] === 'delete_account') { try { db()->beginTransaction(); db()->prepare("DELETE FROM startup_followers WHERE user_id = ?")->execute([$user_id]); db()->prepare("DELETE FROM matches WHERE user1_id = ? OR user2_id = ?")->execute([$user_id, $user_id]); db()->prepare("DELETE FROM swipes WHERE swiper_id = ? OR swiped_id = ?")->execute([$user_id, $user_id]); db()->prepare("DELETE FROM notifications WHERE user_id = ?")->execute([$user_id]); db()->prepare("DELETE FROM users WHERE id = ?")->execute([$user_id]); db()->commit(); session_destroy(); header("Location: login.php?msg=account_deleted"); exit; } catch (Exception $e) { db()->rollBack(); $error = "Account deletion failed: " . $e->getMessage(); } } } ?> Edit Profile — <?= htmlspecialchars($platformName) ?>
<?= htmlspecialchars($platformName) ?> Logo
Log Out

Edit Profile

Back to Dashboard

Manage your public presence in the community.

Danger Zone

Deleting your account is permanent. All your data, startups, and matches will be removed.