What is the common error message when using odbc_connect to connect to a MSSQL database in PHP?

The common error message when using odbc_connect to connect to a MSSQL database in PHP is "Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect". This error typically occurs when the ODBC driver for MSSQL is not properly configured or installed on the server. To solve this issue, you need to ensure that the correct ODBC driver is installed and configured, and that the data source name (DSN) is correctly specified in the connection string.

$dsn = "Driver={SQL Server};Server=your_server;Database=your_database;";
$conn = odbc_connect($dsn, 'username', 'password');

if (!$conn) {
    die("Connection failed: " . odbc_errormsg());
} else {
    echo "Connected successfully!";
}