Bug #73312 [Opn->Fbk]: DBlib continues to return binary data instead of stringified "uniqueidentifier"

From: Date: Thu, 13 Oct 2016 13:26:20 +0000
Subject: Bug #73312 [Opn->Fbk]: DBlib continues to return binary data instead of stringified "uniqueidentifier"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204664@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73312&edit=1 ID: 73312 Updated by: adambaratz@php.net Reported by: Andrey dot Inihov at yandex dot ru Summary: DBlib continues to return binary data instead of stringified "uniqueidentifier" -Status: Open +Status: Feedback Type: Bug Package: PDO DBlib Operating System: Centos 7 PHP Version: 7.0.11 Block user comment: N Private report: N New Comment: I think you need to add this line after creating the PDO instance: $dbh->setAttribute(\PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER, true); The commit that introduced this feature includes a test that should illustrate how it works: https://github.com/php/php-src/commit/a000bff2c3cbfd1d3add3ad22d12824da16479a9 Previous Comments: ------------------------------------------------------------------------ [2016-10-13 10:39:42] Andrey dot Inihov at yandex dot ru Description: ------------ The test script (as well as any sql query intended to retrieve uniqueidentifier from database) keeps returning binary data instead of its' stringified value. PHP Version: 7.0.11 from webtatic Apache: 2.4.6 Test script: --------------- $dbh = new \PDO ("dblib:host=192.168.1.3;dbname=a3ssmDEV", "web_interface", "X9QARIhY"); $stmt = $dbh->prepare("select UserID from a3.dat_dat_User where Login = 'example'"); $stmt->execute(); while ($row = $stmt->fetch()) { print_r($row); } die; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73312&edit=1

« previous php.bugs (#204664) next »