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

  • SEARCH
  • Home
  • 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 3941746
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:34:47+00:00 2026-05-20T00:34:47+00:00

Can anyone guide me on using oci_bind_by_name. I have written this piece of code:

  • 0

Can anyone guide me on using oci_bind_by_name. I have written this piece of code:

$connection = initDB();
$validation_query = "SELECT * from admin where admin_id= :uid and password= :pwd";
$s = oci_parse($connection, $validation_query);
oci_bind_by_name($s, ':uid', $id);
oci_bind_by_name($s, ':pwd', $pass);
$res=oci_execute($s, OCI_DEFAULT);
$result_row = oci_fetch_array($s, OCI_ASSOC);

But with slight modification to Code and generating the query on the fly, it starts working.

$connection = initDB();    
$validation_query = "SELECT * from admin where admin_id= '".$id."' and password= '".$pass."'";
$s = oci_parse($connection, $validation_query);
//oci_bind_by_name($s, ':uid', $id);
//oci_bind_by_name($s, ':pwd', $pass);
$res=oci_execute($s, OCI_DEFAULT);
$result_row = oci_fetch_array($s, OCI_BOTH);

I have no idea on this and have already searched forums and internet. Kindly help me out.

  • 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-20T00:34:47+00:00Added an answer on May 20, 2026 at 12:34 am

    GOT IT !
    Sorry to bother you guys… I made a silly mistake.

    The line of code: $result_row = oci_fetch_array($s, OCI_BOTH)was being executed in both the codes. But in Second scenario $result_row[0] returned values where as $result_row[0] fails in 1st scenario.

    This is again because I was using different MODES of fetching data. OCI_ASSOC in first case and OCI_BOTH in second case.

    So finally when I wrote $result_row['ID'], I got the desired results.

    Cheers !

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

Sidebar

Related Questions

Can anyone guide on how to debug a JNI code on Linux using GDB
Can anyone tell me why is NSAutoreleasePool leaking in this code. I am using
i am trying to genarate XML from xsd using perl can anyone guide me
Can anyone guide me how to convert XLS to CSV using PHP? I have
can anyone please guide me towards using mailchimp with MVC 3.. I have made
Hi can anyone guide me in this problem ? I am reading a .class
Hi i am new in java reflection domain.So can anyone guide me in this
Can anyone guide me how to register a user from mobile device (rest API)
Can anyone guide me or suggest how to make a client using sockets for
Can anyone guide me with sample code regarding how to check whether mobile device

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.