dbs             Fri Feb 25 09:47:45 2005 EDT

  Modified files:              
    /phpdoc/en/reference/pdo    constants.xml 
    /phpdoc/en/reference/pdo/functions  PDOStatement-bindParam.xml 
  Log:
  Add new constants.
  Explain how INOUT and OUT parameters work in bindParam.
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/constants.xml?r1=1.5&r2=1.6&ty=u
Index: phpdoc/en/reference/pdo/constants.xml
diff -u phpdoc/en/reference/pdo/constants.xml:1.5 
phpdoc/en/reference/pdo/constants.xml:1.6
--- phpdoc/en/reference/pdo/constants.xml:1.5   Sat Feb  5 13:52:57 2005
+++ phpdoc/en/reference/pdo/constants.xml       Fri Feb 25 09:47:45 2005
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
 <!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. 
-->
 <section id="pdo.constants">
  &reftitle.constants;
@@ -62,6 +62,19 @@
   </varlistentry>
   <varlistentry>
    <term>
+    <constant>PDO_PARAM_INPUT_OUTPUT</constant>
+     (<type>integer</type>)
+   </term>
+   <listitem>
+    <simpara>
+     Specifies that the parameter is an INOUT parameter for a stored
+     procedure. You must bitwise-OR this value with an explicit
+     PDO_PARAM_* data type.
+    </simpara>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+   <term>
     <constant>PDO_FETCH_LAZY</constant>
      (<type>integer</type>)
    </term>
@@ -176,6 +189,50 @@
   </varlistentry>
   <varlistentry>
    <term>
+    <constant>PDO_FETCH_FUNC</constant>
+     (<type>integer</type>)
+   </term>
+   <listitem>
+    <simpara>
+
+    </simpara>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+   <term>
+    <constant>PDO_FETCH_GROUP</constant>
+     (<type>integer</type>)
+   </term>
+   <listitem>
+    <simpara>
+
+    </simpara>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+   <term>
+    <constant>PDO_FETCH_UNIQUE</constant>
+     (<type>integer</type>)
+   </term>
+   <listitem>
+    <simpara>
+
+    </simpara>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+   <term>
+    <constant>PDO_FETCH_CLASSTYPE</constant>
+     (<type>integer</type>)
+   </term>
+   <listitem>
+    <simpara>
+
+    </simpara>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+   <term>
     <constant>PDO_ATTR_AUTOCOMMIT</constant>
      (<type>integer</type>)
    </term>
http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDOStatement-bindParam.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/pdo/functions/PDOStatement-bindParam.xml
diff -u phpdoc/en/reference/pdo/functions/PDOStatement-bindParam.xml:1.2 
phpdoc/en/reference/pdo/functions/PDOStatement-bindParam.xml:1.3
--- phpdoc/en/reference/pdo/functions/PDOStatement-bindParam.xml:1.2    Thu Nov 
11 03:16:32 2004
+++ phpdoc/en/reference/pdo/functions/PDOStatement-bindParam.xml        Fri Feb 
25 09:47:45 2005
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. 
-->
   <refentry id="function.PDOStatement-bindParam">
    <refnamediv>
@@ -8,11 +8,11 @@
      Binds a parameter to a the specified variable name
     </refpurpose>
    </refnamediv>
-   <refsect1>
-    <title>Description</title>
+   <refsect1 role="description">
+    &reftitle.description;
     <methodsynopsis>
      <type>bool</type><methodname>PDOStatement::bindParam</methodname>
-     
<methodparam><type>mixed</type><parameter>parameter_name</parameter></methodparam>
+     
<methodparam><type>mixed</type><parameter>parameter</parameter></methodparam>
      <methodparam><type>mixed</type><parameter 
role="reference">variable</parameter></methodparam>
      <methodparam 
choice="opt"><type>int</type><parameter>data_type</parameter></methodparam>
      <methodparam 
choice="opt"><type>int</type><parameter>length</parameter></methodparam>
@@ -32,6 +32,60 @@
      For input-only variables, you can pass an array of input values to
      <function>PDOStatement::execute</function> instead.
     </para>
+
+   </refsect1>
+
+   <refsect1 role="parameters">
+    &reftitle.parameters;
+    <para>
+     <variablelist>
+      <varlistentry>
+       <term><parameter>parameter</parameter></term>
+        <listitem>
+         <para>
+          Parameter identifier. For a prepared statement using named
+          placeholders, this will be a parameter name of the form
+          <varname>:name</varname>. For a prepared statement using
+          question mark placeholders, this will be the 1-indexed position of
+          the parameter. 
+         </para>
+        </listitem>
+       </varlistentry>
+      <varlistentry>
+       <term><parameter>variable</parameter></term>
+        <listitem>
+         <para>
+          Name of the PHP variable to bind to the SQL statement parameter.
+         </para>
+        </listitem>
+       </varlistentry>
+      <varlistentry>
+       <term><parameter>data_type</parameter></term>
+        <listitem>
+         <para>
+          Explicit data type for the parameter using the PDO_PARAM_*
+          constants. To return an INOUT parameter from a stored procedure, 
+          use the bitwise OR operator to set the PDO_PARAM_INPUT_OUTPUT bits
+          for the <parameter>data_type</parameter> parameter.
+         </para>
+        </listitem>
+       </varlistentry>
+      <varlistentry>
+       <term><parameter>length</parameter></term>
+        <listitem>
+         <para>
+          Length of the data type. To indicate that a parameter is an OUT
+          parameter from a stored procedure, you must explicitly set the
+          length.
+         </para>
+        </listitem>
+       </varlistentry>
+     </variablelist>
+    </para>
+   </refsect1>
+
+   <refsect1 role="examples">
+    &reftitle.examples;
     <example><title>Execute a prepared statement with named 
placeholders</title>
      <programlisting role='php'>
 <![CDATA[
@@ -68,9 +122,34 @@
      </programlisting>
     </example>
 
+    <example><title>Call a stored procedure with an INOUT parameter</title>
+     <programlisting role='php'>
+<![CDATA[
+<?php
+/* Call a stored procedure with an INOUT parameter */
+$colour = 'red';
+$sth = $dbh->prepare('CALL puree_fruit(?)');
+$sth->bindParam(1, $colour, PDO_PARAM_STR|PDO_PARAM_INPUT_OUTPUT, 12);
+$sth->execute();
+print("After pureeing fruit, the colour is: $colour");
+?>
+]]>
+     </programlisting>
+    </example>
 
 
    </refsect1>
+
+   <refsect1 role="seealso">
+    &reftitle.seealso;
+    <para>
+     <simplelist>
+      <member><function>PDO::prepare</function></member>
+      <member><function>PDOStatement::execute</function></member>
+     </simplelist>
+    </para>
+
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file

Reply via email to