didou Mon Mar 7 17:02:58 2005 EDT
Modified files:
/phpdoc/en/reference/mysql/functions mysql-create-db.xml
mysql-db-query.xml
mysql-drop-db.xml
Log:
fix error message in examples
put the note about deprecation upper and mention other alternatives
fixlets
http://cvs.php.net/diff.php/phpdoc/en/reference/mysql/functions/mysql-create-db.xml?r1=1.11&r2=1.12&ty=u
Index: phpdoc/en/reference/mysql/functions/mysql-create-db.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-create-db.xml:1.11
phpdoc/en/reference/mysql/functions/mysql-create-db.xml:1.12
--- phpdoc/en/reference/mysql/functions/mysql-create-db.xml:1.11 Mon Mar
7 13:23:07 2005
+++ phpdoc/en/reference/mysql/functions/mysql-create-db.xml Mon Mar 7
17:02:58 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-create-db">
<refnamediv>
@@ -23,6 +23,13 @@
<para>
&return.success;
</para>
+ <note>
+ <para>
+ The function <function>mysql_create_db</function> is deprecated. It
+ is preferable to use <function>mysql_query</function> to issue a sql
+ <literal>CREATE DATABASE</literal> statement instead.
+ </para>
+ </note>
<para>
<example>
<title><function>mysql_create_db</function> alternative example</title>
@@ -49,13 +56,6 @@
For downwards compatibility <function>mysql_createdb</function>
can also be used. This is deprecated, however.
</para>
- <note>
- <para>
- The function <function>mysql_create_db</function> is deprecated. It
- is preferable to use <function>mysql_query</function> to issue a
- <literal>SQL CREATE DATABASE</literal> Statement instead.
- </para>
- </note>
<warning>
<para>
This function will not be available
http://cvs.php.net/diff.php/phpdoc/en/reference/mysql/functions/mysql-db-query.xml?r1=1.5&r2=1.6&ty=u
Index: phpdoc/en/reference/mysql/functions/mysql-db-query.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-db-query.xml:1.5
phpdoc/en/reference/mysql/functions/mysql-db-query.xml:1.6
--- phpdoc/en/reference/mysql/functions/mysql-db-query.xml:1.5 Mon Mar 7
13:23:07 2005
+++ phpdoc/en/reference/mysql/functions/mysql-db-query.xml Mon Mar 7
17:02:58 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-db-query">
<refnamediv>
@@ -22,6 +22,13 @@
<literal>INSERT</literal>/<literal>UPDATE</literal>/<literal>DELETE</literal>
queries to indicate success/failure.
</para>
+ <note>
+ <para>
+ This function has been deprecated since PHP 4.0.6.
+ Do not use this function. Use <function>mysql_select_db</function>
+ and <function>mysql_query</function> instead.
+ </para>
+ </note>
<para>
<function>mysql_db_query</function> selects a database and
executes a query on it. If the optional link identifier isn't
@@ -36,8 +43,8 @@
you can't use this function to <emphasis>temporarily</emphasis> run a
sql query on another database, you would have to manually switch back.
Users are strongly encouraged to use the
- <literal>database.table</literal> syntax in their sql queries instead of
- this function.
+ <literal>database.table</literal> syntax in their sql queries or
+ <function>mysql_select_db</function> instead of this function.
</para>
<para>
<example>
@@ -45,14 +52,13 @@
<programlisting role="php">
<![CDATA[
<?php
-$dbname = 'mysql_dbname';
if (!$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
echo 'Could not connect to mysql';
exit;
}
-if (!mysql_select_db($dbname, $link)) {
+if (!mysql_select_db('mysql_dbname', $link)) {
echo 'Could not select database';
exit;
}
@@ -61,7 +67,7 @@
$result = mysql_query($sql, $link);
if (!$result) {
- echo "DB Error, could not list tables\n";
+ echo "DB Error, could not query the database\n";
echo 'MySQL Error: ' . mysql_error();
exit;
}
@@ -71,6 +77,7 @@
}
mysql_free_result($result);
+
?>
]]>
</programlisting>
@@ -80,15 +87,6 @@
See also <function>mysql_connect</function> and
<function>mysql_query</function>.
</para>
- <para>
- <note>
- <simpara>
- This function has been deprecated since PHP 4.0.6.
- Do not use this function. Use <function>mysql_select_db</function>
- and <function>mysql_query</function> instead.
- </simpara>
- </note>
- </para>
</refsect1>
</refentry>
http://cvs.php.net/diff.php/phpdoc/en/reference/mysql/functions/mysql-drop-db.xml?r1=1.11&r2=1.12&ty=u
Index: phpdoc/en/reference/mysql/functions/mysql-drop-db.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-drop-db.xml:1.11
phpdoc/en/reference/mysql/functions/mysql-drop-db.xml:1.12
--- phpdoc/en/reference/mysql/functions/mysql-drop-db.xml:1.11 Mon Mar 7
13:23:07 2005
+++ phpdoc/en/reference/mysql/functions/mysql-drop-db.xml Mon Mar 7
17:02:58 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-drop-db">
<refnamediv>
@@ -25,13 +25,13 @@
</para>
<para>
For downward compatibility <function>mysql_dropdb</function>
- can also be used. This is deprecated, however.
+ can also be used. This is also deprecated, however.
</para>
<note>
<para>
The function <function>mysql_drop_db</function> is deprecated. It is
- preferable to use <function>mysql_query</function> to issue a
- <literal>SQL DROP DATABASE</literal> statement instead.
+ preferable to use <function>mysql_query</function> to issue a sql
+ <literal>DROP DATABASE</literal> statement instead.
</para>
</note>
<para>
@@ -49,7 +49,7 @@
if (mysql_query($sql, $link)) {
echo "Database my_db was successfully dropped\n";
} else {
- echo 'Error creating database: ' . mysql_error() . "\n";
+ echo 'Error dropping database: ' . mysql_error() . "\n";
}
?>
]]>