cleanair4me
Technical User
- May 16, 2008
- 61
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:
Code:
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:
Code:
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.