prepare("SELECT id FROM users WHERE email = :email"); $stmt->execute(['email' => $email]); if ($stmt->fetch()) { $error = 'Email already in use.'; } else { $hashed_password = password_hash($password, PASSWORD_DEFAULT); $stmt = $pdo->prepare("INSERT INTO users (name, email, password, role) VALUES (:name, :email, :password, 'coach')"); if ($stmt->execute(['name' => $name, 'email' => $email, 'password' => $hashed_password])) { $success = 'Registration successful! You can now login.'; } else { $error = 'An error occurred. Please try again.'; } } } } ?>

Create Your Account

Join Drillex to start creating and sharing drills.

Already have an account? Login