georg           Sun Apr 21 09:08:45 2002 EDT

  Modified files:              
    /phpdoc/en/reference/mysql/functions        mysql-affected-rows.xml 
  Log:
  reformatted examples
  
  
Index: phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml:1.3 
phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml:1.4
--- phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml:1.3     Sun Apr 21 
09:04:09 2002
+++ phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml Sun Apr 21 09:08:45 
+2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
   <refentry id="function.mysql-affected-rows">
    <refnamediv>
@@ -56,17 +56,17 @@
       <programlisting role="php">
 <![CDATA[
 <?php
-mysql_pconnect("localhost", "mysql_user", "mysql_password") or
-    die ("Could not connect");
+    /* connect to database */
+    mysql_pconnect("localhost", "mysql_user", "mysql_password") or
+        die ("Could not connect");
 
-/* this should return the correct numbers of deleted records */
-mysql_query("DELETE FROM mytable WHERE id < 10");
-printf ("Records deleted: %d\n", mysql_affected_rows());
-
-/* without a where clause in a delete statement, it should return 0 */
-mysql_query("DELETE FROM mytable");
-printf ("Records deleted: %d\n", mysql_affected_rows());
+    /* this should return the correct numbers of deleted records */
+    mysql_query("DELETE FROM mytable WHERE id < 10");
+    printf ("Records deleted: %d\n", mysql_affected_rows());
 
+    /* without a where clause in a delete statement, it should return 0 */
+    mysql_query("DELETE FROM mytable");
+    printf ("Records deleted: %d\n", mysql_affected_rows());
 ?>
 ]]>
       </programlisting>
@@ -85,11 +85,13 @@
       <programlisting role="php">
 <![CDATA[
 <?php
-mysql_pconnect("localhost", "mysql_user", "mysql_password") or
-    die ("Could not connect");
+    /* connect to database */
+    mysql_pconnect("localhost", "mysql_user", "mysql_password") or
+        die ("Could not connect");
 
-mysql_query("UPDATE mytable SET used=1 WHERE id < 10");
-printf ("Updated records: %d\n", mysql_affected_rpws());
+    /* Update records */
+    mysql_query("UPDATE mytable SET used=1 WHERE id < 10");
+    printf ("Updated records: %d\n", mysql_affected_rpws());
 mysql_query("COMMIT");
 ?>
 ]]>


Reply via email to