From: sven dot goldt dot extern at hvb dot de
Operating system: Windows XP
PHP version: 5.2.3
PHP Bug Type: Oracle related
Bug description: oci8 functions don't retrieve correct date from tables
Description:
------------
When you want to select a column from a table whose type is "DATE" then
php truncates the value so that you only get the day but not the time from
it that mean no hours, no minutes and no seconds.
Reproduce code:
---------------
$query="select datefield from sometable";
$conn = oci_connect("user", "pass", "//dbserver:1521/HVSQP0");
$stmt = oci_parse($conn, $query);
oci_execute($stmt);
while ($result = oci_fetch_row($stmt)) {
print_r($result); print "<br>\n";
}
...
Expected result:
----------------
Something like 01.08.2007 13:45:28
Actual result:
--------------
you get only 01.08.2007.
The only workaround i found so far is to change the query to
"select TO_CHAR(datefield,'DD.MM.YYYY HH24:MI:SS') from sometable".
Then you get what you expect.
--
Edit bug report at http://bugs.php.net/?id=42166&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42166&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42166&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42166&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42166&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42166&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42166&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42166&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42166&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42166&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42166&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42166&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42166&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42166&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42166&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42166&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42166&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42166&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42166&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42166&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42166&r=mysqlcfg