|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74195 OCI_BIND_BY_NAME dates problem
Submitted: 2017-03-02 09:26 UTC Modified: 2017-03-02 11:24 UTC
From: wgizynski at gmail dot com Assigned:
Status: Open Package: PDO OCI
PHP Version: 7.1Git-2017-03-02 (Git) OS: Windows2008 server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: wgizynski at gmail dot com
New email:
PHP Version: OS:


 [2017-03-02 09:26 UTC] wgizynski at gmail dot com
I think there is a problem with binding variables with condition to Date columns in oracle sql.
It gives ORA-01722 invalid number. With numbers and varchars everything is ok.
Putting directly in sql without binding gives a result.
PHP Version 7.1.1
Oracle Run-time Client Library Version 

Test script:
TO_DATE(:ON_DATE,'YYYY-MM-DD') BETWEEN x.fromdate AND x.todate
$onDate = '2017-03-02';
oci_bind_by_name($stid, ":ON_DATE", $onDate)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-02 11:24 UTC] wgizynski at gmail dot com
I have found a reason of my troubles.
IN SQL was another condition:
AND upr.user_id = :USER_ID
I was binding not variable, but method result. ($User->getUserId()).
There is notice that I shouldn't do that.
This is the reason why next bind of date variable gives such error.
I think it shouldnt looks like this, its veery confusing.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Sep 30 23:05:52 2022 UTC