I am connecting to an MS SQL server with PDO using the sqlsrv driver.
PHP version is 5.3.24. The working connection looks like this:
$dsny = "sqlsrv:Server=xx1;Database=xx2"; $usery = 'xx3'; $passwordy = 'xx4'; $dbhy = new PDO($dsny, $usery, $passwordy);
**
But i need to set characters, and then i try this:
$dsny = "sqlsrv:Server=xx1;Database=xx2;charset=utf8"; $usery = 'xx3'; $passwordy = 'xx4'; $dbhy = new PDO($dsny, $usery, $passwordy);
When i add the charset i get this error: "Fatal error: Uncaught exception 'PDFException' with message 'SQLSTATE[IMSSP]: An invalid keyword 'charset' was specified in the dsn string'"
So what could be causing this fault ?
From what i read i need to do like this since i am running a new PHP version.