Ok i inherited a pretty bad DB Situation the Views and Tables are in use and can't or can only with a lot of work be changed.
I am trying to get a Php/Html based Tool to work with the DB.
Here is my Info:
try {
$conn = new PDO("sqlsrv:server=$serverName;Database = $database", $uid, $pwd);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);
} catch (PDOException $e) {
die("Error connecting to SQL Server " . $e);
}
This is my PDO connection and
select * from munition.dbo.V_Admin_Zündhütchen order by Kaliber desc
this my query.
V_Admin_Zündhütchen is a View.
When i fetch the return and dump it like this:
$row = $sql->fetch(PDO::FETCH_ASSOC)
var_dump($row);
I get this:
array (size=5)
'ID' => string '2' (length=1)
'Kaliber' => string '7,62 mm' (length=7)
'Hersteller' => string 'Vihtavuori' (length=10)
'Z�ndtyp' => string 'Boxer' (length=5)
'Bezeichnung' => string '1511' (length=4)
the � is supposed to be a ü
The byte sequence of what is shown as Z�ndtyp
is 5A FC 6E 64 74 79 70
The Data itself is fine only the Columnames are affected:
array (size=5)
'ID' => string '24' (length=2)
'Kaliber' => string '12/70' (length=5)
'Hersteller' => string 'Rottweil' (length=8)
'Z�ndtyp' => string 'Boxer' (length=5)
'Bezeichnung' => string 'Schrotzünder' (length=13)
So why does it not resolve properly?