943,580 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 695
  • PHP RSS
Jan 21st, 2009
0

OCI execute issue

Expand Post »
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:

PHP Syntax (Toggle Plain Text)
  1. require_once('oraConnect.php');
  2. $query = "insert into cityTable values (1, 'George')";
  3. $stmt = oci_parse($db_conn, $query);
  4. oci_execute($stmt);

After commenting out the oci_execute($stmt) line it correctly inserted one record:

PHP Syntax (Toggle Plain Text)
  1. require_once('oraConnect.php');
  2. $query = "insert into cityTable values (1, 'George')";
  3. $stmt = oci_parse($db_conn, $query);
  4. //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.
Reputation Points: 10
Solved Threads: 0
Light Poster
chicago1985 is offline Offline
36 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: changing the value of an array
Next Thread in PHP Forum Timeline: Error message "Parse error: syntax error, unexpected T_STRING in ...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC