mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
fix error message in examples
put the note about deprecation upper and mention other alternatives fixlets git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@181604 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
53885cdb14
commit
1a7f4ff83a
3 changed files with 26 additions and 28 deletions
|
@ -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 @@ if (mysql_query($sql, $link)) {
|
|||
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
|
||||
|
|
|
@ -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 @@ $sql = 'SELECT foo FROM bar WHERE id = 42';
|
|||
$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 @@ while ($row = mysql_fetch_assoc($result)) {
|
|||
}
|
||||
|
||||
mysql_free_result($result);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -80,15 +87,6 @@ mysql_free_result($result);
|
|||
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>
|
||||
|
||||
|
|
|
@ -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 @@ $sql = 'DROP DATABASE my_db';
|
|||
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";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
|
Loading…
Reference in a new issue