Hello,
unfortunaly, my problem is not solved yet. I can’t get a connection to my mssql server2016 without any problems in encoding.
following example in a blank app:
$dsn = "sqlsrv:Server=localhost,1433;Database=db";
$conn = new PDO($dsn, "user", "pwd");
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sql = "SELECT nachname FROM tabelle1 WHERE personalnr = 10026 AND id = 1";
foreach ($conn->query($sql) as $row) {
print_r($row);
};
// Check for record
$check_sql = "SELECT nachname FROM tabelle1 WHERE personalnr = 10026 AND id = 1";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
$str = {rs[0][0]};
}
else // No row found
{
{other_field} = '';
{other_region} = '';
}
echo $str;
Ergebnisse:
Array ( [nachname] => Schönherr [0] => Schönherr ) Sch�nherr
Equipment:
Windows Server 2016 x64
IIS 10.0
ODBC 17 and MS SQL Server Native PDO driver production version php_pdo_sqlsrv_73_nts_x86.dll
Charset is set up to utf-8 in the app settings.
Is there an option in IIS, or in php.ini or somewhere else? How can I define the driver settings, or how can I see how encoding ist set up from scriptcase in the driver?
Thanks!