dbs             Tue Apr 26 13:32:10 2005 EDT

  Modified files:              
    /phpdoc/en/reference/ibm_db2/functions      db2-bind-param.xml 
  Log:
  Correct invalid example (db2_execute() returns a boolean).
  Add inline comments to example.
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml
diff -u phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml:1.2 
phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml:1.3
--- phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml:1.2        Wed Apr 
20 17:16:41 2005
+++ phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml    Tue Apr 26 
13:32:10 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.2. Found in /scripts directory of phpdoc. 
-->
 <refentry id="function.db2-bind-param">
  <refnamediv>
@@ -140,16 +140,19 @@
 $conn = db2_connect($database, $user, $password);
 $stmt = db2_prepare($conn, $sql);
 
+// We can declare the variable before calling db2_bind_param()
 $lower_limit = 1;
 
 db2_bind_param($stmt, 1, "lower_limit", DB2_PARAM_IN);
 db2_bind_param($stmt, 2, "upper_limit", DB2_PARAM_IN);
-$upper_limit = 15.0;
 
-$result = db2_execute($stmt);
+// We can also declare the variable after calling db2_bind_param()
+$upper_limit = 15.0;
 
-while ($row = db2_fetch_into($result)) {
-    print "{$row[0]}, {$row[1]}, {$row[2]}\n"; 
+if (db2_execute($stmt)) {
+    while ($row = db2_fetch_into($stmt)) {
+        print "{$row[0]}, {$row[1]}, {$row[2]}\n";     
+    }
 }
 ?>
 ]]>

Reply via email to