joomla-framework / database

Joomla Framework Database Package
GNU General Public License v2.0
28 stars 34 forks source link

Update SqlsrvDriver.php #281

Closed Kenneth202212 closed 1 month ago

Kenneth202212 commented 1 year ago

Summary of Changes

MS Changed their most recent SQLServer component for PHP to fail on SQL's default self-signed certificate unless you say TrustServerCertificate true. Unfortunately there is no current means to pass that value through the Joomla framework

Testing Instructions

`

$option = array();
$option['driver']   = 'sqlsrv';
$option['host']     = '(host)';
$option['user']     = '(user)'; 
$option['password'] = '(pass) ';
$option['database'] = '(db-name)';
$option['trust_certificate'] = true;

$db = (new Joomla\Database\DatabaseFactory)->getDriver('sqlsrv', $option);

$db->setQuery('SELECT COUNT(*) FROM MyTable');
echo 'Results: ' . (int) $db->loadResult();`

Documentation Changes Required