note 72290 added to function.oci-bind-by-name

From: Date: Thu, 11 Jan 2007 16:48:19 +0000
Subject: note 72290 added to function.oci-bind-by-name
Groups: php.notes 
Request: Send a blank email to php-notes+get-121559@lists.php.net to get a copy of this message
This is an example of returning the primary key from an insert so that you can do inserts on other tables with foreign keys based on that value. The date is just used to provied semi-unique data to be inserted. $conn = oci_connect("username", "password") $stmt = oci_parse($conn, "INSERT INTO test (test_msg) values (:data) RETURN test_id INTO :RV"); $data = date("d-M-Y H:i:s"); oci_bind_by_name($stmt, ":RV", $rv, -1, SQLT_INT); oci_bind_by_name($stmt, ":data", $data, 24); oci_execute($stmt); print $rv; ---- Server IP: 64.71.164.2 Probable Submitter: 150.125.32.242 ---- Manual Page -- http://www.php.net/manual/en/function.oci-bind-by-name.php Edit -- https://master.php.net/note/edit/72290 Del: integrated -- https://master.php.net/note/delete/72290/integrated Del: useless -- https://master.php.net/note/delete/72290/useless Del: bad code -- https://master.php.net/note/delete/72290/bad+code Del: spam -- https://master.php.net/note/delete/72290/spam Del: non-english -- https://master.php.net/note/delete/72290/non-english Del: in docs -- https://master.php.net/note/delete/72290/in+docs Del: other reasons-- https://master.php.net/note/delete/72290 Reject -- https://master.php.net/note/reject/72290 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121559) next »