Home » Open Source » Programming Interfaces » How To Update oracle data from php, by using 'Commit' ? (Oracle 10g XE, PHP 5.2.6, OS Windows7)
How To Update oracle data from php, by using 'Commit' ? [message #541174] Sun, 29 January 2012 02:46 Go to next message
widiarifki
Messages: 3
Registered: January 2012
Location: Indonesia
Junior Member

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:


//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. Very Happy

Regards,
widia.
Re: How To Update oracle data from php, by using 'Commit' ? [message #541178 is a reply to message #541174] Sun, 29 January 2012 03:04 Go to previous messageGo to next message
Michel Cadot
Messages: 60012
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
oci_commit($cur);


Regards
Michel
Re: How To Update oracle data from php, by using 'Commit' ? [message #541221 is a reply to message #541178] Mon, 30 January 2012 01:04 Go to previous message
widiarifki
Messages: 3
Registered: January 2012
Location: Indonesia
Junior Member

Michel Cadot wrote on Sun, 29 January 2012 03:04
oci_commit($cur);


Regards
Michel


Ok, I've got it master!
Thanks
Previous Topic: oracle database driver in winCE
Next Topic: Selecting/Updating/deleting nested table by passing particular index number.
Goto Forum:
  


Current Time: Sun Dec 21 11:37:13 CST 2014

Total time taken to generate the page: 0.11776 seconds