| | |
OCI execute issue
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2007
Posts: 34
Reputation:
Solved Threads: 0
I am using PHP 5.2.5 to insert record into Oracle 9i.
For my database input I was getting two duplicate record inserts when I only needed just one record.
Here is what I had:
After commenting out the oci_execute($stmt) line it correctly inserted one record:
Please advise why the oci_execute($stmt) gave me multiple inserts? I thought I needed the oci_execute($stmt) to execute the insert but it seems that duplicates my database record insert so I eliminated that line and only need the $stmt = oci_parse($db_conn, $query) to insert 1 record.
For my database input I was getting two duplicate record inserts when I only needed just one record.
Here is what I had:
PHP Syntax (Toggle Plain Text)
require_once('oraConnect.php'); $query = "insert into cityTable values (1, 'George')"; $stmt = oci_parse($db_conn, $query); oci_execute($stmt);
After commenting out the oci_execute($stmt) line it correctly inserted one record:
PHP Syntax (Toggle Plain Text)
require_once('oraConnect.php'); $query = "insert into cityTable values (1, 'George')"; $stmt = oci_parse($db_conn, $query); //oci_execute($stmt);
Please advise why the oci_execute($stmt) gave me multiple inserts? I thought I needed the oci_execute($stmt) to execute the insert but it seems that duplicates my database record insert so I eliminated that line and only need the $stmt = oci_parse($db_conn, $query) to insert 1 record.
Last edited by chicago1985; Jan 21st, 2009 at 8:08 pm.
![]() |
Other Threads in the PHP Forum
- Previous Thread: changing the value of an array
- Next Thread: Error message "Parse error: syntax error, unexpected T_STRING in ...
| Thread Tools | Search this Thread |
advanced apache api array basics beginner binary broken cakephp check checkbox class cms code codingproblem combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert ip javascript job joomla js limit link login mail menu mlm mobile multiple mysql nodes oop outofmemmory paging parse password paypal pdf php problem procedure query radio random recursion remote script search server sessions smarty sms source space sql stored syntax system table traffic tutorial unicode up-to-date update upload url validation validator variable video web webapplications youtube





