| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2002-12-09 11:26 UTC] iliaa@php.net
  [2002-12-10 03:10 UTC] f dot vulto at re-base dot com
  [2003-01-02 18:44 UTC] sniper@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
When selecting a datetime field from mssql while the following setting is active: ini_set('mssql.datetimeconvert', 0); the field contains a trailing null character which causes havoc when generating XML. Environment: SQL Server 2000 A workaround is to select the datatime field as CAST(.. AS CHAR). Example script to reproduce the problem: ini_set('mssql.datetimeconvert', 0); $iLinkId = mssql_connect('server', 'username', 'pwd'); mssql_select_db('database', $iLinkId); $iResultId = mssql_query( 'SELECT TESTDATE FROM TEST WHERE TEST_ID = 1' ); $aRow = mssql_fetch_array($iResultId); print $aRow[0] . '|'; print strlen($aRow['TESTDATE']); print '|'; print ord( $aRow['TESTDATE'][strlen($aRow['TESTDATE']) - 1] ); print '<br>'; mssql_close($iLinkId) The output looks like this: 2002-12-31 00:00:00|20|0 indicating the string is 20 characters long, and the last character is a null character (\0).