Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 603033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:53:14+00:00 2026-05-13T16:53:14+00:00

I have a strange issue today related to the oci_bind_by_name function I use in

  • 0

I have a strange issue today related to the oci_bind_by_name function I use in PHP.

Let me give you a showcase.

Here is a table with simple dates:

create table test(col1 date);
insert into test values(to_date('01/01/2009','DD/MM/YYYY'));
insert into test values(to_date('01/01/2019','DD/MM/YYYY'));
insert into test values(to_date('01/01/2029','DD/MM/YYYY'));
insert into test values(to_date('01/01/2039','DD/MM/YYYY'));

Launching this query will result in 2 rows if I bind :dt_maj_deb and :dt_maj_fin to 01/01/2009 and 01/02/2019 for example:

SELECT * 
FROM TEST 
WHERE col1 BETWEEN TO_DATE (:dt_maj_deb, 'DD/MM/YYYY') 
               AND TO_DATE (:dt_maj_fin, 'DD/MM/YYYY')

Results
-------
01.01.2009          
01.01.2019

So everything is as we may expect. My concern is when I want to launch the same query from PHP. Here is my test code:

$query = "SELECT * FROM TEST 
          WHERE col1 BETWEEN TO_DATE (:dt_maj_deb, 'DD/MM/YYYY')
                         AND TO_DATE (:dt_maj_fin, 'DD/MM/YYYY')";
$stmt = oci_parse($conn,$query);
$value = '01/01/2009';
oci_bind_by_name($stmt,':dt_maj_deb',$value);
$value = '01/02/2019';
oci_bind_by_name($stmt,':dt_maj_fin',$value);
oci_execute($stmt);
oci_fetch_all($stmt, $result);
var_dump($result);
oci_free_statement($stmt);
oci_close($conn);

Results
-------
array(1) {
    ["COL1"]=>
       array(0) {}
}

What am I missing??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:53:14+00:00Added an answer on May 13, 2026 at 4:53 pm

    Aren’t you binding both :dt_maj_deb and :dt_maj_fin to the same $value, so when you execute they’ll both hold the same date? As there are no data actually on 01/02/2019 there is nothing to return. If your second $value= was to a date that does exist in the table then you’d get exactly one row back, wouldn’t you? Or, to put it another way, use different variables for the two oci_bind_by_name() calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some strange issue with isset() function in PHP. Let me show... .
I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
Strange issue I am having with my MVC3 project. I have followed a simple
I have some strange issue using jQuery Validation plugin. Firs of all here is
I'am building simple Ajax application (via jquery). I have strange issue. I found where
I have a strange issue. Here is the error message: Call to undefined method
I have a strange issue going on. It may be server related, but I
I have strange spacing issue occurring between servers. I use IE 8 and FF
I have a strange issue (at least for me :)) with the MySQL's locking
I have a strange issue that has arisen recently: Whenever I enter text, even

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.