prepare($sql); $stmt->execute([$email]); if ($stmt->fetch()) { $errors[] = 'Email already exists.'; } else { $sql = "INSERT INTO providers (provider_name, contact_name, email, password) VALUES (?, ?, ?, ?)"; $stmt = $pdo->prepare($sql); $hashed_password = password_hash($password, PASSWORD_DEFAULT); $stmt->execute([$provider_name, $contact_name, $email, $hashed_password]); $success = true; } } catch (PDOException $e) { $errors[] = 'Database error: ' . $e->getMessage(); } } } ?>