|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-03 04:10 UTC] abhargav at in dot ibm dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
Description: ------------ I get an error when trying to execute an SQL with an DATETIME constructor: select DATETIME (00:00) HOUR TO MINUTE from test This equal SQL works perfectly on SQL EDITOR (informix). Reproduce code: --------------- <?php try { print "connecting \n"; $db = new PDO($PDOTEST_DSN, $PDO_USER, $PDO_PASSWD); } catch (PDOException $e) { echo 'Error message: ' . $e->getMessage(); exit; } $db->exec("create table test (fechaid serial not null,fecha datetime year to second,text CHAR(50),primary key (fechaid))"); $db->exec(" insert into test VALUES (0,'2008-03-05 00:00:00','text one'); insert into test VALUES (0,'2008-03-05 00:00:10','text two'); insert into test VALUES (0,'2008-03-05 00:05:02','text three');"); $db->query("select DATETIME (00:00) HOUR TO MINUTE from test"); var_dump($db->errorinfo()); ?> Expected result: ---------------- connecting array(3) { [0]=> string(5) "00000" [1]=> int(0) [2]=> string(24) " ((null)[0] at (null):0)" } Actual result: -------------- connecting array(3) { [0]=> string(5) "42000" [1]=> int(-201) [2]=> string(158) "[Informix][Informix ODBC Driver][Informix]A syntax error has occurred. (SQLPrepare[4294967095] at /tmp/pear/download/PDO_INFORMIX-1.1.0/informix_driver.c:131)" }