|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-28 09:41 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 13:00:01 2025 UTC |
Description: ------------ This summer vacation I used COM(in PHP 5.0.1) to call ADODB in order to read some data from an Access Database. The database contained some fields in date type. Everything just ran well. Later, I removed my pages to another server using PHP 4.3.9 and I found the data in date type can not be read correctly. Should I just update PHP on this server to version above 5.0 in order to solve this problem? Reproduce code: --------------- $MM_Conn_STRING="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db/xinghaiwww.mdb"; $connection=new COM("ADODB.Connection"); $connection->open($MM_Conn_STRING); $rs=new COM("ADODB.RecordSet"); $strsql="select top 5 * from order by article_postdate desc"; $rs->open($strsql,$connection, 1, 1); while (!$rs->eof) { $timestr=$rs->fields['article_postdate']->value; //'article_postdate' is a field in date type //......... //ouput $timestr Expected result: ---------------- in php 5.0.1, $timestr should be: 2004-8-26 17:44:58 Actual result: -------------- in php 4.3.9, it became a string of numbers: 1093513498