Microsoft has not released yet its library for Ubuntu 22.04 (msodbcsql18). So my PHP code does not work anymore:
$SERVER = "192.168.2.51";
$DATABASE = "DB_NAME";
$DRIVER = "/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.9.so.1.1";
const USERNAME = "username";
const PASSWORD = "password";
$db = new PDO("odbc:driver=$DRIVER;server=$SERVER;database=$DATABASE", USERNAME, PASSWORD);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
it returns:
could not find driver
I wonder if there is an alternative method to connect to such a database that uses a different library. The DB is a SQL Server 19.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.