svn: /phpdoc/en/trunk/reference/oci8/functions/ oci-set-client-identifier.xml
| From: | Christopher Jones | Date: | Wed, 13 Jan 2010 01:42:13 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/oci8/functions/ oci-set-client-identifier.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5822@lists.php.net to get a copy of this message | ||
sixd Wed, 13 Jan 2010 01:42:13 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=293475
Log:
Annotate example
Changed paths:
U phpdoc/en/trunk/reference/oci8/functions/oci-set-client-identifier.xml
Modified: phpdoc/en/trunk/reference/oci8/functions/oci-set-client-identifier.xml
===================================================================
--- phpdoc/en/trunk/reference/oci8/functions/oci-set-client-identifier.xml 2010-01-13 01:09:36 UTC
(rev 293474)
+++ phpdoc/en/trunk/reference/oci8/functions/oci-set-client-identifier.xml 2010-01-13 01:42:13 UTC
(rev 293475)
@@ -70,18 +70,23 @@
<title>Setting the client identifier to the application user</title>
<programlisting role="php">
<![CDATA[
-...
<?php
+// Find the application user's login name
session_start();
$un = my_validate_session($_SESSION['username']);
$c = oci_connect('myschema', 'welcome', 'localhost/XE');
+
+// Tell Oracle who that user is
oci_set_client_identifier($c, $un);
+// The next roundtrip to the database will piggyback the identifier
$s = oci_parse($c, 'select mydata from mytable');
+oci_execute($s);
+...
+
?>
-...
]]>
</programlisting>
</example>