Doc #55083 [Bgs]: working with varbinary on mssql
| From: | RQuadling@php.net | Date: | Mon, 04 Jul 2011 10:38:28 +0000 |
| Subject: | Doc #55083 [Bgs]: working with varbinary on mssql | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6829@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55083&edit=1
ID: 55083
Updated by: RQuadling@php.net
Reported by: aznboy84 at gmail dot com
Summary: working with varbinary on mssql
Status: Bogus
Type: Documentation Problem
Package: MSSQL related
Operating System: Windows XP x64
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
The new MS SQL Server Driver for PHP also comes in a PDO variant.
http://www.php.net/manual/en/intro.mssql.php
-> http://msdn.microsoft.com/en-
us/sqlserver/ff657782.aspx
Previous Comments:
------------------------------------------------------------------------
[2011-07-01 16:29:37] frozenfire@php.net
The PDO MSSQL driver is known to be very buggy, and has been replaced by the
sqlsrv extension. If you must use PDO for MSSQL, you might try using the ODBC
driver.
In any case, this isn't a documentation issue.
------------------------------------------------------------------------
[2011-06-30 04:24:28] aznboy84 at gmail dot com
Description:
------------
I have a MSSQL table with a varbinary(5600) field and i found no way to get it with PDO, got
"Invalid sql_display_size" on $stmt->fetch()
<?php
date_default_timezone_set("Asia/Saigon");
require "connect.php";
$stmt = $MSSQL->prepare("SELECT SCFS5Quest FROM SCFS5Quest WHERE Name =
'hack'");
$stmt->execute(array('hack'));
$stmt->bindColumn(1, $lob, PDO::PARAM_LOB,1,PDO::SQLSRV_ENCODING_BINARY);
$stmt->fetch(PDO::FETCH_BOUND);
//print_r($scf);
echo bin2hex($scf);
?>
Test script:
---------------
<?php
date_default_timezone_set("Asia/Saigon");
require "connect.php";
$stmt = $MSSQL->prepare("SELECT SCFS5Quest FROM SCFS5Quest WHERE Name =
'hack'");
$stmt->execute(array('hack'));
$stmt->bindColumn(1, $lob, PDO::PARAM_LOB,1,PDO::SQLSRV_ENCODING_BINARY);
$stmt->fetch(PDO::FETCH_BOUND);
//print_r($scf);
echo bin2hex($scf);
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55083&edit=1