php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15170 datetime fields returns " :" string instead of field's value
Submitted: 2002-01-22 13:56 UTC Modified: 2002-10-30 05:44 UTC
Votes:14
Avg. Score:4.7 ± 0.7
Reproduced:13 of 13 (100.0%)
Same Version:6 (46.2%)
Same OS:10 (76.9%)
From: royal at altech dot com dot pl Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.2.3 OS: FreeBSD-4.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: royal at altech dot com dot pl
New email:
PHP Version: OS:

 

 [2002-01-22 13:56 UTC] royal at altech dot com dot pl
<?
  $msid=mssql_connect ($server,$user,$pass);
  mssql_select_db("database", $msid);
  $msres=mssql_query("SELECT * FROM TABLE", $msid);
  $ret=mssql_fetch_row($msres);
// or   $ret=mssql_fetch_array($msres);
// or   $ret=mssql_fetch_object($msres);
// or   $ret=mssql_fetch_field($msres,23);
// or   $ret=mssql_result ($msres, 0, 23);
  var_dump($ret);
?>

every field is returned correctly except of 'datetime' type fields which instead turns to be string(4) containing "   :" or hexadecimally: x20x20x20x3a.

I use freetds 0.53 connecting to MSSQL 7.0 server.
The 'sqsh' tool works correct. It seems the problem exists in PHP code.
It doesn't matter if I use sybase_* or mssql_* functions, the results are the same!

configure line (taken from phpinfo()): 
 './configure' '--with-apxs=/usr/local/sbin/apxs' '--with-config-file-path=/usr/local/etc' '--enable-versioning' '--with-system-regex' '--disable-debug' '--enable-track-vars' '--without-gd' '--without-mysql' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-zlib' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-imap-ssl=/usr/local' '--with-mysql=/usr/local' '--with-sybase=/usr/local' '--with-ldap=/usr/local' '--with-xml' '--with-expat-dir=/usr/local' '--enable-xslt' '--with-xslt-sablot' '--with-expat-dir=/usr/local' '--enable-ftp' '--with-curl=/usr/local' '--with-gettext=/usr/local' '--with-iconv=/usr/local' '--with-pspell=/usr/local' '--with-ming=/usr/local' '--enable-sockets' '--enable-trans-sid' '--with-imap=/usr/local' '--with-iconv=/usr/local' '--prefix=/usr/local' 'i386--freebsd4.4'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-22 23:31 UTC] royal at altech dot com dot pl
I temporarly worked around the problem by using
CAST(DATE_FIELD AS VARCHAR(256)) AS DATE
but this is not a solution.


 [2002-04-02 22:04 UTC] pipperl at pchome dot com dot tw
The PHP version 4.1.2 on FreeBSD-4.5 has the same bug
 [2002-10-14 22:55 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-10-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, 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".
 [2002-10-30 05:44 UTC] royal at altech dot com dot pl
It seems this bug has been resolved in php 4.2.3.
The DATA fields are being imported correctly. (with freetds-0.60/FreeBSD 4.7)
Thanks 4 your support.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue May 17 14:05:46 2022 UTC