⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

Checking Supported Drivers with getAvailableDrivers()

The getAvailableDrivers() method is a static method of the PDO class that returns an array of all available drivers currently installed on your PHP server. Because the method is static, we call it directly using the class name (PDO::getAvailableDrivers()), meaning we do not even need an active database connection to check for support. This is crucial when deploying applications to new servers, where we need to verify if the MySQL or any other driver is enabled at all.

EXAMPLE
RESULT
The result will be displayed here...

Practical Application: We use this method in system tools or installation wizards (installers) to warn the user if their server does not support the required database. Check the process at home by following these steps: