1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How To Update oracle data from php, by using 'Commit' ?

Discussion in 'Oracle Development General' started by widiarifki, Jan 29, 2012.

  1. widiarifki

    widiarifki Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    dear everybody,

    I want to ask something that make me confuse. About work using PHP n Oracle together.

    I want to update an existing data on oracle table. I use this script:

    Code (Text):


    //connect to database
    $conn=ora_logon("hr","hr");
    $cur=ora_open($conn);

    $no_dept=$_POST['no_dept'];
    $nm_dept=$_POST['name_dept'];

    ora_parse($cur, "update departement set nm_dept='$nm_dept' where no_dept='$no_dept'");
    ora_exec($cur);

     
    Going well, without error. But, when I go back to index.php which showing fetching data from department table. The data which I have updated doesn't change. I think it needs 'COMMIT'. But how I use it on PHP??

    Please help your Junior.
    Thanks for your response. :D

    Regards,
    widia.
     
  2. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Your information is not complete, but I would hazard a guess that you need to use oci_commit/ocicommit to commit the transaction to the database.
     
    widiarifki likes this.