OCI execute issue

Reply

Join Date: Nov 2007
Posts: 34
Reputation: chicago1985 is an unknown quantity at this point 
Solved Threads: 0
chicago1985 chicago1985 is offline Offline
Light Poster

OCI execute issue

 
0
  #1
Jan 21st, 2009
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:

  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:

  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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC