Server: DB2 7.1.0
Client: 11.5.4.0
PHP: 8.2.17
pdo_ibm: latest main branch
There is no problem with the following command line:
db2 "SELECT ONAME from MYTABLE where ID='590'"
However, retrieving data via PHP like this:
$dbh = new PDO($dsn);
$result = $dbh->query("SELECT ONAME from MYTABLE where ID='590'");
foreach($result as $row){
echo $row[0];
}
At the end of the string, there is a 0x00 and some other random characters.
trim($row[0],"\x0")
can remove the trash characters.
Server: DB2 7.1.0
Client: 11.5.4.0
PHP: 8.2.17
pdo_ibm: latest main branch
There is no problem with the following command line:
db2 "SELECT ONAME from MYTABLE where ID='590'"However, retrieving data via PHP like this:
At the end of the string, there is a 0x00 and some other random characters.
trim($row[0],"\x0")can remove the trash characters.