chicago1985 0 Light Poster

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:

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:

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.