cvs: phpdoc /en/reference/mysql/functions mysql-affected-rows.xml mysql-fetch-object.xml mysql-field-name.xml mysql-real-escape-string.xml
| From: | Mehdi Achour | Date: | Sat, 17 May 2003 18:33:59 +0000 |
| Subject: | cvs: phpdoc /en/reference/mysql/functions mysql-affected-rows.xml mysql-fetch-object.xml mysql-field-name.xml mysql-real-escape-string.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969353581@lists.php.net to get a copy of this message | ||
didou Sat May 17 14:33:59 2003 EDT
Modified files:
/phpdoc/en/reference/mysql/functions mysql-affected-rows.xml
mysql-fetch-object.xml
mysql-field-name.xml
mysql-real-escape-string.xml
Log:
correcting examples
Index: phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml:1.6
phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml:1.7
--- phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml:1.6 Sun Dec 1 21:37:29 2002
+++ phpdoc/en/reference/mysql/functions/mysql-affected-rows.xml Sat May 17 14:33:59 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-affected-rows">
<refnamediv>
@@ -59,7 +59,8 @@
/* connect to database */
mysql_pconnect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
-
+ mysql_select_db("mydb");
+
/* 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());
@@ -88,6 +89,7 @@
/* connect to database */
mysql_pconnect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
+ mysql_select_db("mydb");
/* Update records */
mysql_query("UPDATE mytable SET used=1 WHERE id < 10");
Index: phpdoc/en/reference/mysql/functions/mysql-fetch-object.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-fetch-object.xml:1.2
phpdoc/en/reference/mysql/functions/mysql-fetch-object.xml:1.3
--- phpdoc/en/reference/mysql/functions/mysql-fetch-object.xml:1.2 Wed Apr 17 02:41:11 2002
+++ phpdoc/en/reference/mysql/functions/mysql-fetch-object.xml Sat May 17 14:33:59 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-fetch-object">
<refnamediv>
@@ -48,8 +48,8 @@
<![CDATA[
<?php
mysql_connect("hostname", "user", "password");
-mysql_select_db($db);
-$result = mysql_query("select * from table");
+mysql_select_db("mydb");
+$result = mysql_query("select * from mytable");
while ($row = mysql_fetch_object($result)) {
echo $row->user_id;
echo $row->fullname;
Index: phpdoc/en/reference/mysql/functions/mysql-field-name.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-field-name.xml:1.3
phpdoc/en/reference/mysql/functions/mysql-field-name.xml:1.4
--- phpdoc/en/reference/mysql/functions/mysql-field-name.xml:1.3 Sun Dec 1 21:37:29 2002
+++ phpdoc/en/reference/mysql/functions/mysql-field-name.xml Sat May 17 14:33:59 2003
@@ -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-field-name">
<refnamediv>
@@ -41,6 +41,7 @@
* password.
*/
$link = mysql_connect('localhost', "mysql_user", "mysql_password");
+$dbname = "mydb";
mysql_select_db($dbname, $link)
or die("Could not set $dbname: " . mysql_error());
$res = mysql_query("select * from users", $link);
Index: phpdoc/en/reference/mysql/functions/mysql-real-escape-string.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-real-escape-string.xml:1.3
phpdoc/en/reference/mysql/functions/mysql-real-escape-string.xml:1.4
--- phpdoc/en/reference/mysql/functions/mysql-real-escape-string.xml:1.3 Mon Apr 29 07:02:21 2002
+++ phpdoc/en/reference/mysql/functions/mysql-real-escape-string.xml Sat May 17 14:33:59 2003
@@ -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.100 -->
<refentry id="function.mysql-real-escape-string">
<refnamediv>
@@ -32,7 +32,6 @@
<programlisting role="php">
<![CDATA[
<?php
-$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$item = "Zak's and Derick's Laptop";
$escaped_item = mysql_real_escape_string($item);
printf ("Escaped string: %s\n", $escaped_item);