202.160.160.12221474tabuser2023KsmErpAttempting connection using SQLSRV native driver...
KMLHP_REDSELTOSKsmErp72Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64)
Mar 18 2018 09:11:49
Copyright (...❌ SQLSRV Connection: FAILED
Query failedSQLSRV Error Details:
SQLSTATE: 42000 Code: 156 Message: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Incorrect syntax near the keyword 'current_time'.
| Extension | Available | Status | Details |
|---|---|---|---|
| PDO_SQLSRV | ❌ No | N/A | Extension not loaded |
| SQLSRV | ✅ Yes | ✅ SUCCESS | Connect: 280.2ms |
| PDO_ODBC | ❌ No | N/A | Extension not loaded |
Your PHP environment can successfully connect to the MSSQL server. You can use any of the successful connection methods in your application.
SQLSRV is available and working well:
<?php
$serverName = "202.160.160.122,21474";
$connectionInfo = [
"Database" => "KsmErp",
"UID" => "tabuser2023",
"PWD" => "iKsml#2023"
];
$conn = sqlsrv_connect($serverName, $connectionInfo);
if ($conn === false) {
die(print_r(sqlsrv_errors(), true));
}
// Example query
$sql = "SELECT * FROM your_table";
$stmt = sqlsrv_query($conn, $sql);
if ($stmt === false) {
die(print_r(sqlsrv_errors(), true));
}
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
echo $row['column_name'] . "\n";
}
sqlsrv_free_stmt($stmt);
sqlsrv_close($conn);
?>