php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45463 PDO fetch problem with MSSQL unicode nvarchar or ntext
Submitted: 2008-07-09 08:49 UTC Modified: 2009-05-03 01:00 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: stane dot ferencak at gmail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
41 + 37 = ?
Subscribe to this entry?

 
 [2008-07-09 08:49 UTC] stane dot ferencak at gmail dot com
Description:
------------
When reading data, stored in nvarchar or ntext type from MS SQL Database (2000 or 2005), a special charecter is automatically inserted after 248b of text. Type of this charecter is unknown.
This happens regardless of the way how data is inserted.

Reproduce code:
---------------
$conn_obj = new PDO ('odbc:Driver={SQL Server};Server='.$dbserver.';Database='.$dbname.';Uid='.$dbuser.';Pwd='.$dbpass.';');
  $rs_obj = $conn_obj->prepare($sql);
  $rs_obj->execute();
  $ln = $rs_obj->fetchAll();
  print_r($ln);

Expected result:
----------------
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sodales. Pellentesque et metus sed sapien varius tristique. Vestibulum sagittis porttitor leo. Aliquam sapien. Curabitur felis nisl, condimentum vel, commodo blandit, fringilla lacinia, elit. Etiam facilisis venenatis quam. Sed magna. Duis id risus id lacus auctor volutpat. Mauris non augue eu lorem adipiscing vehicula. Sed blandit nibh vel nisl. Fusce semper nisi viverra purus. Nam bibendum magna sit amet odio. Praesent id augue ac diam tristique rutrum. Morbi interdum dictum nulla. Donec tortor nunc, tempor vitae, tincidunt eu, varius nec, mi.

Actual result:
--------------
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sodales. Pellentesque et metus sed sapien varius tristique. Vestibulum sagittis porttitor leo. Aliquam sapien. Curabitur felis nisl, condimentum vel, commodo blandit, fringilla lacinia, elit�. Etiam facilisis venenatis quam. Sed magna. Duis id risus id lacus auctor volutpat. Mauris non augue eu lorem adipiscing vehicula. Sed blandit nibh vel nisl. Fusce semper nisi viverra purus. Nam bibendum magna sit amet odio. Praesent id augue ac diam tristique rutrum. Morbi interdum dictum nulla. Donec tortor nunc, tempor vitae, tincidunt eu, varius nec, mi.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-25 15:09 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 11:01:32 2024 UTC