prepare('SELECT id FROM users WHERE email = ?'); $stmt->execute([$email]); if ($stmt->fetch()) { $error = 'An account with this email already exists.'; } else { $password_hash = password_hash($password, PASSWORD_DEFAULT); $pdo->prepare('INSERT INTO users (email, password_hash, role) VALUES (?, ?, ?)') ->execute([$email, $password_hash, $role]); $user_id = $pdo->lastInsertId(); // Create a basic profile $pdo->prepare('INSERT INTO user_profiles (user_id, name, bio) VALUES (?, ?, ?)') ->execute([$user_id, 'New User', 'Please update your bio.']); $success = 'Registration successful! You can now log in.'; } } } ?> Register

Register

Already have an account? Login here