PHP for SQL Server without ODBC or MSSQL support

I am in a situation where my Windows hosting has PHP support, but PHP is not configured to support ODBC or MSSQL. I can't get them to change this, so I'm wondering if there is a way to connect to SQL Server using other means - perhaps including some files that provide the functions I need?

+4
source share
1 answer

Found a solution:

http://www.php.net/manual/en/ref.mssql.php#42696

Leaving him here in the hope that it will make it easier for other people to get around this type of restriction.

Copied here for completeness:

<?php $db = new COM("ADODB.Connection"); $dsn = "DRIVER={SQL Server}; SERVER={SERVER};UID={USER};PWD={PASS}; DATABASE={DB}"; $db->Open($dsn); $rs = $db->Execute("SELECT * FROM table"); while (!$rs->EOF) { echo $rs->Fields['column']->Value."<BR>"; $rs->MoveNext(); } ?> 
+4
source

Source: https://habr.com/ru/post/978369/


All Articles