reformatted examples

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@79291 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Georg Richter 2002-04-21 13:08:45 +00:00
parent 264e0ec899
commit f032c17f89

View file

@ -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 @@ Records deleted: 0
<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");
?>
]]>