When using the PDO ASSOC statement I am only getting first letter of the column instead of the full one. Any ideas ? More information below :
Small code block to fetch_assoc via PHP :
$pdo = new PDO("xxx", "user","pwd");
$pdo->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_TO_STRING);
$query = $pdo->query("SELECT TRND.TRANID FROM PCRMTRND AS TRND");
$query->execute();
$tmp = array();
while($row=$query->fetch(PDO::FETCH_ASSOC)) {
array_push($tmp,$row);
}
After filling array tmp :
Var DUMP each row :
Settings of ODBC :
[xxx]
Description = iSeries ODBC
Driver = IBM i Access ODBC Driver
System = /
UserID =
Password =
Naming = 0
DefaultLibraries = QGPL
Database =
ConnectionType = 0
CommitMode = 2
ExtendedDynamic = 1
DefaultPkgLibrary = QGPL
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression = 1
LibraryView = 0
AllowUnsupportedChar = 0
ForceTranslation = 0
Trace = 0
I encountered the same issue, it seems it has something to do with locale settings. When I changed LC_ALL from "en_US.UTF-8" to "en_US.ISO-8859-1" the problem disappeared. Hence I don't have the output in UTF :(