Skip to content

garbage characters at the end of string #26

Description

@vividy163

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions