| | |
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 |
Tag cloud for PHP
.htaccess access ajax alerts apache api array beginner binary broken cakephp checkbox class cms code convert cron curl database date directory display download dynamic echo email error file files folder form forms function functions google hack href htaccess html htmlspecialchars image include insert integration ip java javascript joomla limit link login loop mail menu methods mlm mod_rewrite multiple mysql network object oop overwrite parse paypal pdf php problem query radio random recursion redirect regex remote script search securephp server sessions sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube





