3

I'm new to Oracle and using OCI with PHP. I've been doing ok until I've tried to do an update statement.

include("ORCLconfig.php");

$updateTitleInserted = oci_parse($conn, "UPDATE insured SET INSURED_TITLE=
'$updateTitle' WHERE INSURED_ID='$INSURED_ID'");

oci_execute($updateTitleInserted, OCI_COMMIT_ON_SUCCESS); 

oci_free_statement($updateTitleInserted); 


oci_close($conn);

All I'm trying to do is and update statement so the user can change the Title of a person. I am using AJAX to do this asynchronously and when the user attempts to change the title to the current value it processes the function fine but if the new value is different it gets stuck at the update statement and no change is made.

2
  • This may sound basic, so excuse me if so, but have you tried the same code in a flat file with the values hardcoded? I can't see in your snippet where the variables are being set. Do you see any errors? Commented Oct 24, 2012 at 23:20
  • it was a bit silly of my but i was calling the wrong variable for insured title... didn't see it before because this is my first project using error logs instead of having errors displayed on the page Commented Oct 25, 2012 at 8:31

1 Answer 1

4
$c = oci_connect($userName, $password, "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =$serverName)(PORT = 1521)))(CONNECT_DATA=(SID=$databaseName)))");
$strQuery = "UPDATE table SET field = :xx WHERE ID = 123"
  $stmt = OCIParse($c, $strQuery);

    OCIBindByName($stmt, ':xx', $fieldval);



      $ok = OCIExecute($stmt);

try this

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.