#38805 [Opn->Asn]: PDO Truncates Text from SQL Server Text Data Type Field

From: Date: Fri, 15 Sep 2006 07:04:25 +0000
Subject: #38805 [Opn->Asn]: PDO Truncates Text from SQL Server Text Data Type Field
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102213@lists.php.net to get a copy of this message
 ID:               38805
 Updated by:       tony2001@php.net
 Reported By:      gkrajci at arescorporation dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         PDO related
 Operating System: Windows NT PBMA-WB2 5.2 build 37
 PHP Version:      5.1.6
 Assigned To:      wez


Previous Comments:
------------------------------------------------------------------------

[2006-09-14 11:47:26] gkrajci at arescorporation dot com

Microsoft SQL Server connections

PHP.INI
---------------------------
extension=php_pdo.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll

PDO
PDO support enabled 
PDO drivers  mssql, mysql  

pdo_mssql
PDO Driver for MSSQL DB-lib enabled 
Flavour  MSSQL_70  

pdo_mysql
PDO Driver for MySQL, client library version 5.0.22

------------------------------------------------------------------------

[2006-09-13 15:45:31] wez@php.net

I assume you're using ODBC?

------------------------------------------------------------------------

[2006-09-13 15:40:37] iliaa@php.net

what PDO driver are you using?

------------------------------------------------------------------------

[2006-09-13 13:06:35] gkrajci at arescorporation dot com

Description:
------------
When using PDO to retrieve text from a SQL Server text data type field
the text is truncated when I display it on a Web page

PDO Transcript length = 4096 (truncated)
PEAR Transcript length = 6139(full text)

Using SQL Server 2000

Reproduce code:
---------------
$sql = "SELECT title AS VideoTitle, transcript_text AS TranscriptText
FROM video WHERE video_id = 324";

$dbh = new PDO($pdo_dsn, $db_user, $db_password);
$transcript_q = $dbh->query($sql);
$transcript_rs = $transcript_q->fetch();

$pear_dsn = "$db_type://$db_user:$db_password@$db_host/$db_name";
require_once( 'DB.php' );
$db = DB::connect( $pear_dsn, true );
if ( DB::isError($db) ) die( $db->getMessage() );

$res = $db->query($sql);
$row = $res->fetchRow();

Expected result:
----------------
The text in TranscriptText to be the text and the same length.

Actual result:
--------------
See Description for this bug report.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38805&edit=1


Thread (42 messages)

« previous php.bugs (#102213) next »