|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2015-09-08 14:36 UTC] cmb@php.net
 
-Status:      Open
+Status:      Feedback
-Package:     ODBC related
+Package:     PDO ODBC
-Assigned To:
+Assigned To: cmb
  [2015-09-08 14:36 UTC] cmb@php.net
  [2015-09-20 04:22 UTC] php-bugs at lists dot php dot net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 17:00:02 2025 UTC | 
Description: ------------ Environment: Windows Server 2003 EE MS SQL server 8.0.818 (MSDE 2000) PHP 5.2.6(or high) as ISAPI or cli I have a table 'session': [id] [char](32) NOT NULL DEFAULT (''), [expiry] [bigint] NOT NULL DEFAULT ('0'), [data] [ntext] NOT NULL DEFAULT ('') When I retrive data from table and size of data more then 255 bytes, I found symbol with code 0(as EOL for strings) in the 255 position of the string. Reproduce code: --------------- <?php $dbname = "session_db"; $username = "sa"; $pw = "1q2w3e"; $pdo = new PDO ("odbc:session_db","sa","1q2w3e"); $query = $pdo->query("delete from session"); $string = '--'; $string .= '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; $string .= '--'; echo 'Length of source string: '.strlen($string)."\n"; $query = $pdo->query("insert into session values('".md5(time())."', ".time().", '".$string."')"); var_dump($query); $rowset = $pdo->query("select * from session"); if($rowset === false) { var_dump($pdo->errorInfo()); } var_dump($rowset); $string = $rowset->fetchAll(); //$string = $rowset->fetchColumn(2); var_dump($string); echo 'Length of target string: '.strlen($string[0][2])."\n"; ?> Expected result: ---------------- 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Actual result: -------------- 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123_45678901234567890123456789012345678901234567890