cvs: phpdoc-zh /reference/mysql/functions mysql-change-user.xml mysql-client-encoding.xml mysql-close.xml mysql-connect.xml
| From: | Dallas Thunder | Date: | Mon, 19 Sep 2005 17:02:44 +0000 |
| Subject: | cvs: phpdoc-zh /reference/mysql/functions mysql-change-user.xml mysql-client-encoding.xml mysql-close.xml mysql-connect.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2669@lists.php.net to get a copy of this message | ||
dallas Mon Sep 19 13:02:44 2005 EDT
Modified files:
/phpdoc-zh/reference/mysql/functions mysql-change-user.xml
mysql-client-encoding.xml
mysql-close.xml
mysql-connect.xml
Log:
Updated.
http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-change-user.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-change-user.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-change-user.xml:1.1 phpdoc-zh/reference/mysql/functions/mysql-change-user.xml:1.2 --- phpdoc-zh/reference/mysql/functions/mysql-change-user.xml:1.1 Tue Feb 25 04:00:30 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-change-user.xml Mon Sep 19 13:02:43 2005 @@ -1,40 +1,117 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-change-user"> - <refnamediv> - <refname>mysql_change_user</refname> - <refpurpose> - ¸Ä±ä»î¶¯Á¬½ÓÖеǼµÄÓû§ - </refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>mysql_change_user</methodname> - <methodparam><type>string</type><parameter>user</parameter></methodparam> - <methodparam><type>string</type><parameter>password</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter> - database - </parameter></methodparam> - <methodparam choice="opt"><type>resource</type><parameter> - link_identifier - </parameter></methodparam> - </methodsynopsis> - <para> - <function>mysql_change_user</function> - ¸Ä±äµ±Ç°»î¶¯Á¬½ÓÖеĵǼÓû§£¬»òÕßÊÇ¿ÉÑ¡µÄ <parameter>link_identifier</parameter> - ²ÎÊýËùÖ¸¶¨µÄÁ¬½Ó¡£Èç¹ûÖ¸Ã÷ÁËÊý¾Ý¿â£¬½«ÔڸıäÓû§ºó³ÉΪµ±Ç°Êý¾Ý¿â¡£Èç¹ûÐÂÓû§ºÍÃÜÂëÈÏ֤ʧ°Ü£¬µ±Ç°Á¬½ÓµÄÓû§±£³Ö»î¶¯×´Ì¬¡£&return.success; - </para> - <note> - <para> - ±¾º¯Êý×Ô PHP 3.0.13 Òý½ø²¢ÐèÒª MySQL 3.23.3 - »ò¸ü¸ß°æ±¾¡£²»ÄÜÓÃÓÚ PHP 4¡£ - </para> - </note> - </refsect1> - </refentry> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-change-user"> + <refnamediv> + <refname>mysql_change_user</refname> + <refpurpose>¸Ä±ä»î¶¯Á¬½ÓÖеǼµÄÓû§</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>mysql_change_user</methodname> + <methodparam><type>string</type><parameter>user</parameter></methodparam> + <methodparam><type>string</type><parameter>password</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>database</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> + </methodsynopsis> + <para> + <function>mysql_change_user</function> + ¸Ä±äµ±Ç°»î¶¯Á¬½ÓÖеĵǼÓû§£¬»òÕßÊÇ¿ÉÑ¡µÄ <parameter>link_identifier</parameter> + ²ÎÊýËùÖ¸¶¨µÄÁ¬½Ó¡£Èç¹ûÖ¸Ã÷ÁËÊý¾Ý¿â£¬½«ÔڸıäÓû§ºó³ÉΪµ±Ç°Êý¾Ý¿â¡£Èç¹ûÐÂÓû§ºÍÃÜÂëÈÏ֤ʧ°Ü£¬µ±Ç°Á¬½ÓµÄÓû§±£³Ö»î¶¯×´Ì¬¡£ + </para> + <para> + ±¾º¯ÊýÒÑ·ÏÆú£¬²»ÔÙ´æÔÚÓÚ PHP ÖС£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>user</parameter></term> + <listitem> + <para> + Ð嵀 MySQL Óû§Ãû¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>password</parameter></term> + <listitem> + <para> + Ð嵀 MySQL ÃÜÂë¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>database</parameter></term> + <listitem> + <para> + MySQL Êý¾Ý¿â¡£Èç¹ûδָ¶¨£¬ÔòʹÓõ±Ç°ÒÑÑ¡ÔñµÄÊý¾Ý¿â¡£ + </para> + </listitem> + </varlistentry> + &mysql.linkid.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>3.0.14</entry> + <entry> + ±¾º¯Êý×Ô PHP ÖÐɾ³ý¡£ + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <title>ÐèÇó</title> + <para> + ±¾º¯ÊýÐèÒª MySQL 3.23.3 »ò¸ü¸ß°æ±¾¡£ + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_connect</function></member> + <member><function>mysql_select_db</function></member> + <member><function>mysql_query</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml:1.2 phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml:1.3 --- phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml:1.2 Mon Aug 18 19:57:06 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml Mon Sep 19 13:02:43 2005 @@ -1,48 +1,74 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-client-encoding"> - <refnamediv> - <refname>mysql_client_encoding</refname> - <refpurpose>·µ»Ø×Ö·û¼¯µÄÃû³Æ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>mysql_client_encoding</methodname> - <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> - </methodsynopsis> - <para> - <function>mysql_client_encoding</function> ·µ»Øµ±Ç°Á¬½ÓµÄĬÈÏ×Ö·û¼¯Ãû³Æ¡£ - </para> - <para> - <example> - <title><function>mysql_client_encoding</function> Àý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-client-encoding"> + <refnamediv> + <refname>mysql_client_encoding</refname> + <refpurpose>·µ»Ø×Ö·û¼¯µÄÃû³Æ</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>mysql_client_encoding</methodname> + <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> + </methodsynopsis> + <para> + ´Ó MySQL ÖÐÈ¡µÃ <literal>character_set</literal> ±äÁ¿µÄÖµ¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &mysql.linkid.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ·µ»Øµ±Ç°Á¬½ÓµÄĬÈÏ×Ö·û¼¯Ãû³Æ¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mysql_client_encoding</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php -$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); +$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $charset = mysql_client_encoding($link); -printf ("current character set is %s\n", $charset); + +echo "The current character set is: $charset\n"; ?> ]]> - </programlisting> - <para> - ÒÔÉÏÀý×Ó½«²úÉúÈçÏÂÊä³ö£º - </para> - <screen> + </programlisting> + &example.outputs.similar; + <screen> <![CDATA[ -current character set is latin1 +The current character set is: latin1 ]]> - </screen> - </example> - </para> - <para> - ²Î¼û <function>mysql_real_escape_string</function>¡£ - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_real_escape_string</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-close.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-close.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-close.xml:1.2 phpdoc-zh/reference/mysql/functions/mysql-close.xml:1.3 --- phpdoc-zh/reference/mysql/functions/mysql-close.xml:1.2 Mon Aug 18 19:57:06 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-close.xml Mon Sep 19 13:02:43 2005 @@ -1,60 +1,94 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-close"> - <refnamediv> - <refname>mysql_close</refname> - <refpurpose>¹Ø±Õ MySQL Á¬½Ó</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>mysql_close</methodname> - <methodparam choice="opt"><type>resource</type><parameter> - link_identifier - </parameter></methodparam> - </methodsynopsis> - <para> - &return.success; - </para> - <para> - <function>mysql_close</function> ¹Ø±ÕÖ¸¶¨µÄÁ¬½Ó±êʶËù¹ØÁªµÄµ½ - MySQL ·þÎñÆ÷µÄÁ¬½Ó¡£Èç¹ûûÓÐÖ¸¶¨ - <parameter>link_identifier</parameter>£¬Ôò¹Ø±ÕÉÏÒ»¸ö´ò¿ªµÄÁ¬½Ó¡£ - </para> - <para> - ͨ³£²»ÐèҪʹÓà - <function>mysql_close</function>£¬ÒòΪÒÑ´ò¿ªµÄ·Ç³Ö¾ÃÁ¬½Ó»áÔڽű¾Ö´ÐÐÍê±Ïºó×Ô¶¯¹Ø±Õ¡£²Î¼û<link - linkend="language.types.resource.self-destruct">ÊÍ·Å×ÊÔ´</link>¡£ - </para> - <note> - <para> - <function>mysql_close</function> ²»»á¹Ø±ÕÓÉ - <function>mysql_pconnect</function> ½¨Á¢µÄ³Ö¾ÃÁ¬½Ó¡£ - </para> - </note> - <para> - <example> - <title>MySQL ¹Ø±ÕÀý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-close"> + <refnamediv> + <refname>mysql_close</refname> + <refpurpose>¹Ø±Õ MySQL Á¬½Ó</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>mysql_close</methodname> + <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> + </methodsynopsis> + <para> + <function>mysql_close</function> ¹Ø±ÕÖ¸¶¨µÄÁ¬½Ó±êʶËù¹ØÁªµÄµ½ + MySQL ·þÎñÆ÷µÄ·Ç³Ö¾ÃÁ¬½Ó¡£Èç¹ûûÓÐÖ¸¶¨ + <parameter>link_identifier</parameter>£¬Ôò¹Ø±ÕÉÏÒ»¸ö´ò¿ªµÄÁ¬½Ó¡£ + </para> + <para> + ͨ³£²»ÐèҪʹÓà + <function>mysql_close</function>£¬ÒòΪÒÑ´ò¿ªµÄ·Ç³Ö¾ÃÁ¬½Ó»áÔڽű¾Ö´ÐÐÍê±Ïºó×Ô¶¯¹Ø±Õ¡£²Î¼û<link + linkend="language.types.resource.self-destruct">ÊÍ·Å×ÊÔ´</link>¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &mysql.linkid.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mysql_close</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php - $link = mysql_connect("localhost", "mysql_user", "mysql_password") - or die("Could not connect: " . mysql_error()); - print ("Connected successfully"); - mysql_close($link); +$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); +if (!$link) { + die('Could not connect: ' . mysql_error()); +} +echo 'Connected successfully'; +mysql_close($link); ?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>mysql_connect</function> ºÍ - <function>mysql_pconnect</function>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Connected successfully +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + <function>mysql_close</function> ²»»á¹Ø±ÕÓÉ + <function>mysql_pconnect</function> ½¨Á¢µÄ³Ö¾ÃÁ¬½Ó¡£ + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_connect</function></member> + <member><function>mysql_free_result</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-connect.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-connect.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-connect.xml:1.2 phpdoc-zh/reference/mysql/functions/mysql-connect.xml:1.3 --- phpdoc-zh/reference/mysql/functions/mysql-connect.xml:1.2 Mon Aug 18 19:57:06 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-connect.xml Mon Sep 19 13:02:43 2005 @@ -1,100 +1,193 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-connect"> - <refnamediv> - <refname>mysql_connect</refname> - <refpurpose>´ò¿ªÒ»¸öµ½ MySQL ·þÎñÆ÷µÄÁ¬½Ó</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>resource</type><methodname>mysql_connect</methodname> - <methodparam choice="opt"><type>string</type><parameter>server</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam> - <methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>client_flags</parameter></methodparam> - </methodsynopsis> - <para> - Èç¹û³É¹¦Ôò·µ»ØÒ»¸ö MySQL Á¬½Ó±êʶ£¬Ê§°ÜÔò·µ»Ø &false;¡£ - </para> - <para> - <function>mysql_connect</function> ½¨Á¢Ò»¸öµ½ MySQL - ·þÎñÆ÷µÄÁ¬½Ó¡£µ±Ã»ÓÐÌṩ¿ÉÑ¡²ÎÊýʱʹÓÃÒÔÏÂĬÈÏÖµ£º<parameter>server</parameter> - = 'localhost:3306'£¬<parameter>username</parameter> - = ·þÎñÆ÷½ø³ÌËùÓÐÕßµÄÓû§Ãû£¬<parameter>password</parameter> - = ¿ÕÃÜÂë¡£ - </para> - <para> - <parameter>server</parameter> ²ÎÊý¿ÉÒÔ°üÀ¨¶Ë¿ÚºÅ¡£ÀýÈç - "hostname:port" »òÕßÊǵ½±¾µØÌ×½Ó×ֵķ¾¶£¬ÀýÈç±¾»úÉ쵀 - ":/path/to/socket"¡£ - <note> - <para> - ÎÞÂÛÖ¸¶¨ "localhost" »òÕß - "localhost:port" ×÷Ϊ - <parameter>server</parameter>£¬MySQL ¿Í»§¶Ë¿â½«¸²¸ÇÖ®²¢³¢ÊÔÁ¬½Óµ½±¾µØÌ×½Ó×Ö£¨Windows - ÖеÄÃû×ֹܵÀ£©¡£Èç¹ûÏ£ÍûʹÓà TCP/IP Á¬½Ó£¬Óà "127.0.0.1" Ìæ´ú - "localhost"¡£Èç¹û MySQL - ¿Í»§¶Ë¿âÊÔͼÁ¬½Óµ½´íÎóµÄ±¾µØÌ×½Ó×Ö£¬ÔòÓ¦¸ÃÔÚ PHP ÅäÖÃÖн« - mysql.default_host ÉèΪÕýÈ·µÄ·¾¶²¢Ê¹ server ×Ö¶ÎΪ¿Õ¡£ - </para> - <para> - ":port" µÄÖ§³ÖÊÇ PHP 3.0B4 Æð¼ÓÈëµÄ¡£ - </para> - <para> - ":/path/to/socket" µÄÖ§³ÖÊÇ PHP 3.0.10 Æð¼ÓÈëµÄ¡£ - </para> - <para> - ¿ÉÒÔÔÚº¯ÊýÃûǰ¼ÓÉÏ <link linkend="language.operators.errorcontrol">@</link> - À´ÒÖÖÆÊ§°Üʱ²úÉúµÄ´íÎóÐÅÏ¢¡£ - </para> - </note> - </para> - <para> - Èç¹ûÓÃͬÑùµÄ²ÎÊýµÚ¶þ´Îµ÷Óà - <function>mysql_connect</function>£¬½«²»»á½¨Á¢ÐÂÁ¬½Ó£¬¶ø½«·µ»ØÒѾ´ò¿ªµÄÁ¬½Ó±êʶ¡£²ÎÊý - <parameter>new_link</parameter> ¸Ä±ä´ËÐÐΪ²¢Ê¹ - <function>mysql_connect</function> ×ÜÊÇ´ò¿ªÐµÄÁ¬½Ó£¬ÉõÖÁµ± - <function>mysql_connect</function> ÔøÔÚÇ°Ãæ±»ÓÃͬÑùµÄ²ÎÊýµ÷Óùý¡£²ÎÊý - <parameter>client_flags</parameter> ¿ÉÒÔÊÇÒÔϳ£Á¿µÄ×éºÏ£ºMYSQL_CLIENT_COMPRESS£¬MYSQL_CLIENT_IGNORE_SPACE - »òÕß MYSQL_CLIENT_INTERACTIVE¡£ - </para> - <note> - <para> - <parameter>new_link</parameter> ²ÎÊý×Ô PHP 4.2.0 Æð¿ÉÓᣠ- </para> - <para> - <parameter>client_flags</parameter> ²ÎÊý×Ô PHP 4.3.0 Æð¿ÉÓᣠ- </para> - </note> - <para> - Ò»µ©½Å±¾½áÊø£¬µ½·þÎñÆ÷µÄÁ¬½Ó¾Í»á±»¹Ø±Õ¡£³ý·Ç֮ǰÒѾµ÷ÓÃÁË - <function>mysql_close</function> À´¹Ø±ÕËü¡£ - </para> - <para> - <example> - <title>MySQL Á¬½ÓÀý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.16 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-connect"> + <refnamediv> + <refname>mysql_connect</refname> + <refpurpose>´ò¿ªÒ»¸öµ½ MySQL ·þÎñÆ÷µÄÁ¬½Ó</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>resource</type><methodname>mysql_connect</methodname> + <methodparam choice="opt"><type>string</type><parameter>server</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>client_flags</parameter></methodparam> + </methodsynopsis> + <para> + ´ò¿ª»òÖØ¸´Ê¹ÓÃÒ»¸öµ½ MySQL ·þÎñÆ÷µÄÁ¬½Ó¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>server</parameter></term> + <listitem> + <para> + MySQL ·þÎñÆ÷¡£¿ÉÒÔ°üÀ¨¶Ë¿ÚºÅ£¬ÀýÈç + "hostname:port"£¬»òÕßµ½±¾µØÌ×½Ó×ֵķ¾¶£¬ÀýÈç¶ÔÓÚ localhost µÄ ":/path/to/socket"¡£ + </para> + <para> + Èç¹û PHP Ö¸Áî <link linkend="ini.mysql.default-host"> + mysql.default_host</link> 䶨Ò壨ĬÈÏÇé¿ö£©£¬ÔòĬÈÏÖµÊÇ 'localhost:3306'¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>username</parameter></term> + <listitem> + <para> + Óû§Ãû¡£Ä¬ÈÏÖµÊÇ·þÎñÆ÷½ø³ÌËùÓÐÕßµÄÓû§Ãû¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>password</parameter></term> + <listitem> + <para> + ÃÜÂ롣ĬÈÏÖµÊÇ¿ÕÃÜÂë¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>new_link</parameter></term> + <listitem> + <para> + Èç¹ûÓÃͬÑùµÄ²ÎÊýµÚ¶þ´Îµ÷Óà + <function>mysql_connect</function>£¬½«²»»á½¨Á¢ÐÂÁ¬½Ó£¬¶ø½«·µ»ØÒѾ´ò¿ªµÄÁ¬½Ó±êʶ¡£²ÎÊý + <parameter>new_link</parameter> ¸Ä±ä´ËÐÐΪ²¢Ê¹ + <function>mysql_connect</function> ×ÜÊÇ´ò¿ªÐµÄÁ¬½Ó£¬ÉõÖÁµ± + <function>mysql_connect</function> ÔøÔÚÇ°Ãæ±»ÓÃͬÑùµÄ²ÎÊýµ÷Óùý¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>client_flags</parameter></term> + <listitem> + <para> + <parameter>client_flags</parameter> + ²ÎÊý¿ÉÒÔÊÇÒÔϳ£Á¿µÄ×éºÏ£º<constant>MYSQL_CLIENT_COMPRESS</constant>£¬<constant>MYSQL_CLIENT_IGNORE_SPACE</constant> + »ò <constant>MYSQL_CLIENT_INTERACTIVE</constant>¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Èç¹û³É¹¦Ôò·µ»ØÒ»¸ö MySQL Á¬½Ó±êʶ£¬Ê§°ÜÔò·µ»Ø &false;¡£ + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.3.0</entry> + <entry> + Ìí¼Ó <parameter>client_flags</parameter> ²ÎÊý¡£ + </entry> + </row> + <row> + <entry>4.2.0</entry> + <entry> + Ìí¼Ó <parameter>new_link</parameter> ²ÎÊý¡£ + </entry> + </row> + <row> + <entry>3.0.10</entry> + <entry> + ¶Ô <parameter>server</parameter> Ìí¼Ó ":/path/to/socket" Ö§³Ö¡£ + </entry> + </row> + <row> + <entry>3.0.0</entry> + <entry> + ¶Ô <parameter>server</parameter> Ìí¼Ó ":port" Ö§³Ö¡£ + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mysql_connect</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php - $link = mysql_connect("localhost", "mysql_user", "mysql_password") - or die("Could not connect: " . mysql_error()); - print ("Connected successfully"); - mysql_close($link); +$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); +if (!$link) { + die('Could not connect: ' . mysql_error()); +} +echo 'Connected successfully'; +mysql_close($link); ?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>mysql_pconnect</function> ºÍ - <function>mysql_close</function>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Ö»Òª½« server Ö¸¶¨Îª "localhost" »ò + "localhost:port"£¬MySQL ¿Í»§¶Ë¿â»áÔ½¹ý´ËÖµ²¢³¢ÊÔÁ¬½Óµ½±¾µØÌ×½Ó×Ö£¨Windows + ÖеÄÃû×ֹܵÀ£©¡£Èç¹ûÏëÓà TCP/IP£¬Ó¦¸ÃÓà "127.0.0.1" + ´úÌæ "localhost"¡£Èç¹û MySQL ¿Í»§¶Ë¿âÊÔͼÁ¬½Óµ½Ò»¸ö´íÎóµÄ±¾µØÌ×½Ó×Ö£¬ÔòÓ¦¸ÃÔÚ + PHP ÅäÖÃÖÐÉ趨 mysql.default_host µÄÕýȷ·¾¶²¢°Ñ server Áô¿Õ¡£ + </para> + </note> + <note> + <para> + ½Å±¾Ò»½áÊø£¬µ½·þÎñÆ÷µÄÁ¬½Ó¾Í±»¹Ø±Õ£¬³ý·Ç֮ǰÒѾÃ÷È·µ÷Óà + <function>mysql_close</function> ¹Ø±ÕÁË¡£ + </para> + </note> + <note> + <para> + ¿ÉÒÔÔÚº¯ÊýÃûǰ¼ÓÉÏÒ»¸ö + <link linkend="language.operators.errorcontrol">@</link> + À´ÒÖÖÆ³ö´íʱµÄ´íÎóÐÅÏ¢¡£ + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_pconnect</function></member> + <member><function>mysql_close</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables:
http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-change-user.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-change-user.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-change-user.xml:1.1 phpdoc-zh/reference/mysql/functions/mysql-change-user.xml:1.2 --- phpdoc-zh/reference/mysql/functions/mysql-change-user.xml:1.1 Tue Feb 25 04:00:30 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-change-user.xml Mon Sep 19 13:02:43 2005 @@ -1,40 +1,117 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-change-user"> - <refnamediv> - <refname>mysql_change_user</refname> - <refpurpose> - ¸Ä±ä»î¶¯Á¬½ÓÖеǼµÄÓû§ - </refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>mysql_change_user</methodname> - <methodparam><type>string</type><parameter>user</parameter></methodparam> - <methodparam><type>string</type><parameter>password</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter> - database - </parameter></methodparam> - <methodparam choice="opt"><type>resource</type><parameter> - link_identifier - </parameter></methodparam> - </methodsynopsis> - <para> - <function>mysql_change_user</function> - ¸Ä±äµ±Ç°»î¶¯Á¬½ÓÖеĵǼÓû§£¬»òÕßÊÇ¿ÉÑ¡µÄ <parameter>link_identifier</parameter> - ²ÎÊýËùÖ¸¶¨µÄÁ¬½Ó¡£Èç¹ûÖ¸Ã÷ÁËÊý¾Ý¿â£¬½«ÔڸıäÓû§ºó³ÉΪµ±Ç°Êý¾Ý¿â¡£Èç¹ûÐÂÓû§ºÍÃÜÂëÈÏ֤ʧ°Ü£¬µ±Ç°Á¬½ÓµÄÓû§±£³Ö»î¶¯×´Ì¬¡£&return.success; - </para> - <note> - <para> - ±¾º¯Êý×Ô PHP 3.0.13 Òý½ø²¢ÐèÒª MySQL 3.23.3 - »ò¸ü¸ß°æ±¾¡£²»ÄÜÓÃÓÚ PHP 4¡£ - </para> - </note> - </refsect1> - </refentry> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-change-user"> + <refnamediv> + <refname>mysql_change_user</refname> + <refpurpose>¸Ä±ä»î¶¯Á¬½ÓÖеǼµÄÓû§</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>mysql_change_user</methodname> + <methodparam><type>string</type><parameter>user</parameter></methodparam> + <methodparam><type>string</type><parameter>password</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>database</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> + </methodsynopsis> + <para> + <function>mysql_change_user</function> + ¸Ä±äµ±Ç°»î¶¯Á¬½ÓÖеĵǼÓû§£¬»òÕßÊÇ¿ÉÑ¡µÄ <parameter>link_identifier</parameter> + ²ÎÊýËùÖ¸¶¨µÄÁ¬½Ó¡£Èç¹ûÖ¸Ã÷ÁËÊý¾Ý¿â£¬½«ÔڸıäÓû§ºó³ÉΪµ±Ç°Êý¾Ý¿â¡£Èç¹ûÐÂÓû§ºÍÃÜÂëÈÏ֤ʧ°Ü£¬µ±Ç°Á¬½ÓµÄÓû§±£³Ö»î¶¯×´Ì¬¡£ + </para> + <para> + ±¾º¯ÊýÒÑ·ÏÆú£¬²»ÔÙ´æÔÚÓÚ PHP ÖС£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>user</parameter></term> + <listitem> + <para> + Ð嵀 MySQL Óû§Ãû¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>password</parameter></term> + <listitem> + <para> + Ð嵀 MySQL ÃÜÂë¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>database</parameter></term> + <listitem> + <para> + MySQL Êý¾Ý¿â¡£Èç¹ûδָ¶¨£¬ÔòʹÓõ±Ç°ÒÑÑ¡ÔñµÄÊý¾Ý¿â¡£ + </para> + </listitem> + </varlistentry> + &mysql.linkid.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>3.0.14</entry> + <entry> + ±¾º¯Êý×Ô PHP ÖÐɾ³ý¡£ + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <title>ÐèÇó</title> + <para> + ±¾º¯ÊýÐèÒª MySQL 3.23.3 »ò¸ü¸ß°æ±¾¡£ + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_connect</function></member> + <member><function>mysql_select_db</function></member> + <member><function>mysql_query</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml:1.2 phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml:1.3 --- phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml:1.2 Mon Aug 18 19:57:06 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-client-encoding.xml Mon Sep 19 13:02:43 2005 @@ -1,48 +1,74 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-client-encoding"> - <refnamediv> - <refname>mysql_client_encoding</refname> - <refpurpose>·µ»Ø×Ö·û¼¯µÄÃû³Æ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>mysql_client_encoding</methodname> - <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> - </methodsynopsis> - <para> - <function>mysql_client_encoding</function> ·µ»Øµ±Ç°Á¬½ÓµÄĬÈÏ×Ö·û¼¯Ãû³Æ¡£ - </para> - <para> - <example> - <title><function>mysql_client_encoding</function> Àý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-client-encoding"> + <refnamediv> + <refname>mysql_client_encoding</refname> + <refpurpose>·µ»Ø×Ö·û¼¯µÄÃû³Æ</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>mysql_client_encoding</methodname> + <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> + </methodsynopsis> + <para> + ´Ó MySQL ÖÐÈ¡µÃ <literal>character_set</literal> ±äÁ¿µÄÖµ¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &mysql.linkid.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ·µ»Øµ±Ç°Á¬½ÓµÄĬÈÏ×Ö·û¼¯Ãû³Æ¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mysql_client_encoding</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php -$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); +$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $charset = mysql_client_encoding($link); -printf ("current character set is %s\n", $charset); + +echo "The current character set is: $charset\n"; ?> ]]> - </programlisting> - <para> - ÒÔÉÏÀý×Ó½«²úÉúÈçÏÂÊä³ö£º - </para> - <screen> + </programlisting> + &example.outputs.similar; + <screen> <![CDATA[ -current character set is latin1 +The current character set is: latin1 ]]> - </screen> - </example> - </para> - <para> - ²Î¼û <function>mysql_real_escape_string</function>¡£ - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_real_escape_string</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-close.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-close.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-close.xml:1.2 phpdoc-zh/reference/mysql/functions/mysql-close.xml:1.3 --- phpdoc-zh/reference/mysql/functions/mysql-close.xml:1.2 Mon Aug 18 19:57:06 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-close.xml Mon Sep 19 13:02:43 2005 @@ -1,60 +1,94 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-close"> - <refnamediv> - <refname>mysql_close</refname> - <refpurpose>¹Ø±Õ MySQL Á¬½Ó</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>mysql_close</methodname> - <methodparam choice="opt"><type>resource</type><parameter> - link_identifier - </parameter></methodparam> - </methodsynopsis> - <para> - &return.success; - </para> - <para> - <function>mysql_close</function> ¹Ø±ÕÖ¸¶¨µÄÁ¬½Ó±êʶËù¹ØÁªµÄµ½ - MySQL ·þÎñÆ÷µÄÁ¬½Ó¡£Èç¹ûûÓÐÖ¸¶¨ - <parameter>link_identifier</parameter>£¬Ôò¹Ø±ÕÉÏÒ»¸ö´ò¿ªµÄÁ¬½Ó¡£ - </para> - <para> - ͨ³£²»ÐèҪʹÓà - <function>mysql_close</function>£¬ÒòΪÒÑ´ò¿ªµÄ·Ç³Ö¾ÃÁ¬½Ó»áÔڽű¾Ö´ÐÐÍê±Ïºó×Ô¶¯¹Ø±Õ¡£²Î¼û<link - linkend="language.types.resource.self-destruct">ÊÍ·Å×ÊÔ´</link>¡£ - </para> - <note> - <para> - <function>mysql_close</function> ²»»á¹Ø±ÕÓÉ - <function>mysql_pconnect</function> ½¨Á¢µÄ³Ö¾ÃÁ¬½Ó¡£ - </para> - </note> - <para> - <example> - <title>MySQL ¹Ø±ÕÀý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-close"> + <refnamediv> + <refname>mysql_close</refname> + <refpurpose>¹Ø±Õ MySQL Á¬½Ó</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>mysql_close</methodname> + <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> + </methodsynopsis> + <para> + <function>mysql_close</function> ¹Ø±ÕÖ¸¶¨µÄÁ¬½Ó±êʶËù¹ØÁªµÄµ½ + MySQL ·þÎñÆ÷µÄ·Ç³Ö¾ÃÁ¬½Ó¡£Èç¹ûûÓÐÖ¸¶¨ + <parameter>link_identifier</parameter>£¬Ôò¹Ø±ÕÉÏÒ»¸ö´ò¿ªµÄÁ¬½Ó¡£ + </para> + <para> + ͨ³£²»ÐèҪʹÓà + <function>mysql_close</function>£¬ÒòΪÒÑ´ò¿ªµÄ·Ç³Ö¾ÃÁ¬½Ó»áÔڽű¾Ö´ÐÐÍê±Ïºó×Ô¶¯¹Ø±Õ¡£²Î¼û<link + linkend="language.types.resource.self-destruct">ÊÍ·Å×ÊÔ´</link>¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &mysql.linkid.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mysql_close</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php - $link = mysql_connect("localhost", "mysql_user", "mysql_password") - or die("Could not connect: " . mysql_error()); - print ("Connected successfully"); - mysql_close($link); +$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); +if (!$link) { + die('Could not connect: ' . mysql_error()); +} +echo 'Connected successfully'; +mysql_close($link); ?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>mysql_connect</function> ºÍ - <function>mysql_pconnect</function>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Connected successfully +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + <function>mysql_close</function> ²»»á¹Ø±ÕÓÉ + <function>mysql_pconnect</function> ½¨Á¢µÄ³Ö¾ÃÁ¬½Ó¡£ + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_connect</function></member> + <member><function>mysql_free_result</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/mysql/functions/mysql-connect.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/mysql/functions/mysql-connect.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-connect.xml:1.2 phpdoc-zh/reference/mysql/functions/mysql-connect.xml:1.3 --- phpdoc-zh/reference/mysql/functions/mysql-connect.xml:1.2 Mon Aug 18 19:57:06 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-connect.xml Mon Sep 19 13:02:43 2005 @@ -1,100 +1,193 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> - <refentry id="function.mysql-connect"> - <refnamediv> - <refname>mysql_connect</refname> - <refpurpose>´ò¿ªÒ»¸öµ½ MySQL ·þÎñÆ÷µÄÁ¬½Ó</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>resource</type><methodname>mysql_connect</methodname> - <methodparam choice="opt"><type>string</type><parameter>server</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam> - <methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>client_flags</parameter></methodparam> - </methodsynopsis> - <para> - Èç¹û³É¹¦Ôò·µ»ØÒ»¸ö MySQL Á¬½Ó±êʶ£¬Ê§°ÜÔò·µ»Ø &false;¡£ - </para> - <para> - <function>mysql_connect</function> ½¨Á¢Ò»¸öµ½ MySQL - ·þÎñÆ÷µÄÁ¬½Ó¡£µ±Ã»ÓÐÌṩ¿ÉÑ¡²ÎÊýʱʹÓÃÒÔÏÂĬÈÏÖµ£º<parameter>server</parameter> - = 'localhost:3306'£¬<parameter>username</parameter> - = ·þÎñÆ÷½ø³ÌËùÓÐÕßµÄÓû§Ãû£¬<parameter>password</parameter> - = ¿ÕÃÜÂë¡£ - </para> - <para> - <parameter>server</parameter> ²ÎÊý¿ÉÒÔ°üÀ¨¶Ë¿ÚºÅ¡£ÀýÈç - "hostname:port" »òÕßÊǵ½±¾µØÌ×½Ó×ֵķ¾¶£¬ÀýÈç±¾»úÉ쵀 - ":/path/to/socket"¡£ - <note> - <para> - ÎÞÂÛÖ¸¶¨ "localhost" »òÕß - "localhost:port" ×÷Ϊ - <parameter>server</parameter>£¬MySQL ¿Í»§¶Ë¿â½«¸²¸ÇÖ®²¢³¢ÊÔÁ¬½Óµ½±¾µØÌ×½Ó×Ö£¨Windows - ÖеÄÃû×ֹܵÀ£©¡£Èç¹ûÏ£ÍûʹÓà TCP/IP Á¬½Ó£¬Óà "127.0.0.1" Ìæ´ú - "localhost"¡£Èç¹û MySQL - ¿Í»§¶Ë¿âÊÔͼÁ¬½Óµ½´íÎóµÄ±¾µØÌ×½Ó×Ö£¬ÔòÓ¦¸ÃÔÚ PHP ÅäÖÃÖн« - mysql.default_host ÉèΪÕýÈ·µÄ·¾¶²¢Ê¹ server ×Ö¶ÎΪ¿Õ¡£ - </para> - <para> - ":port" µÄÖ§³ÖÊÇ PHP 3.0B4 Æð¼ÓÈëµÄ¡£ - </para> - <para> - ":/path/to/socket" µÄÖ§³ÖÊÇ PHP 3.0.10 Æð¼ÓÈëµÄ¡£ - </para> - <para> - ¿ÉÒÔÔÚº¯ÊýÃûǰ¼ÓÉÏ <link linkend="language.operators.errorcontrol">@</link> - À´ÒÖÖÆÊ§°Üʱ²úÉúµÄ´íÎóÐÅÏ¢¡£ - </para> - </note> - </para> - <para> - Èç¹ûÓÃͬÑùµÄ²ÎÊýµÚ¶þ´Îµ÷Óà - <function>mysql_connect</function>£¬½«²»»á½¨Á¢ÐÂÁ¬½Ó£¬¶ø½«·µ»ØÒѾ´ò¿ªµÄÁ¬½Ó±êʶ¡£²ÎÊý - <parameter>new_link</parameter> ¸Ä±ä´ËÐÐΪ²¢Ê¹ - <function>mysql_connect</function> ×ÜÊÇ´ò¿ªÐµÄÁ¬½Ó£¬ÉõÖÁµ± - <function>mysql_connect</function> ÔøÔÚÇ°Ãæ±»ÓÃͬÑùµÄ²ÎÊýµ÷Óùý¡£²ÎÊý - <parameter>client_flags</parameter> ¿ÉÒÔÊÇÒÔϳ£Á¿µÄ×éºÏ£ºMYSQL_CLIENT_COMPRESS£¬MYSQL_CLIENT_IGNORE_SPACE - »òÕß MYSQL_CLIENT_INTERACTIVE¡£ - </para> - <note> - <para> - <parameter>new_link</parameter> ²ÎÊý×Ô PHP 4.2.0 Æð¿ÉÓᣠ- </para> - <para> - <parameter>client_flags</parameter> ²ÎÊý×Ô PHP 4.3.0 Æð¿ÉÓᣠ- </para> - </note> - <para> - Ò»µ©½Å±¾½áÊø£¬µ½·þÎñÆ÷µÄÁ¬½Ó¾Í»á±»¹Ø±Õ¡£³ý·Ç֮ǰÒѾµ÷ÓÃÁË - <function>mysql_close</function> À´¹Ø±ÕËü¡£ - </para> - <para> - <example> - <title>MySQL Á¬½ÓÀý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.16 Maintainer: dallas Status: ready --> +<refentry id="function.mysql-connect"> + <refnamediv> + <refname>mysql_connect</refname> + <refpurpose>´ò¿ªÒ»¸öµ½ MySQL ·þÎñÆ÷µÄÁ¬½Ó</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>resource</type><methodname>mysql_connect</methodname> + <methodparam choice="opt"><type>string</type><parameter>server</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>client_flags</parameter></methodparam> + </methodsynopsis> + <para> + ´ò¿ª»òÖØ¸´Ê¹ÓÃÒ»¸öµ½ MySQL ·þÎñÆ÷µÄÁ¬½Ó¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>server</parameter></term> + <listitem> + <para> + MySQL ·þÎñÆ÷¡£¿ÉÒÔ°üÀ¨¶Ë¿ÚºÅ£¬ÀýÈç + "hostname:port"£¬»òÕßµ½±¾µØÌ×½Ó×ֵķ¾¶£¬ÀýÈç¶ÔÓÚ localhost µÄ ":/path/to/socket"¡£ + </para> + <para> + Èç¹û PHP Ö¸Áî <link linkend="ini.mysql.default-host"> + mysql.default_host</link> 䶨Ò壨ĬÈÏÇé¿ö£©£¬ÔòĬÈÏÖµÊÇ 'localhost:3306'¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>username</parameter></term> + <listitem> + <para> + Óû§Ãû¡£Ä¬ÈÏÖµÊÇ·þÎñÆ÷½ø³ÌËùÓÐÕßµÄÓû§Ãû¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>password</parameter></term> + <listitem> + <para> + ÃÜÂ롣ĬÈÏÖµÊÇ¿ÕÃÜÂë¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>new_link</parameter></term> + <listitem> + <para> + Èç¹ûÓÃͬÑùµÄ²ÎÊýµÚ¶þ´Îµ÷Óà + <function>mysql_connect</function>£¬½«²»»á½¨Á¢ÐÂÁ¬½Ó£¬¶ø½«·µ»ØÒѾ´ò¿ªµÄÁ¬½Ó±êʶ¡£²ÎÊý + <parameter>new_link</parameter> ¸Ä±ä´ËÐÐΪ²¢Ê¹ + <function>mysql_connect</function> ×ÜÊÇ´ò¿ªÐµÄÁ¬½Ó£¬ÉõÖÁµ± + <function>mysql_connect</function> ÔøÔÚÇ°Ãæ±»ÓÃͬÑùµÄ²ÎÊýµ÷Óùý¡£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>client_flags</parameter></term> + <listitem> + <para> + <parameter>client_flags</parameter> + ²ÎÊý¿ÉÒÔÊÇÒÔϳ£Á¿µÄ×éºÏ£º<constant>MYSQL_CLIENT_COMPRESS</constant>£¬<constant>MYSQL_CLIENT_IGNORE_SPACE</constant> + »ò <constant>MYSQL_CLIENT_INTERACTIVE</constant>¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Èç¹û³É¹¦Ôò·µ»ØÒ»¸ö MySQL Á¬½Ó±êʶ£¬Ê§°ÜÔò·µ»Ø &false;¡£ + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.3.0</entry> + <entry> + Ìí¼Ó <parameter>client_flags</parameter> ²ÎÊý¡£ + </entry> + </row> + <row> + <entry>4.2.0</entry> + <entry> + Ìí¼Ó <parameter>new_link</parameter> ²ÎÊý¡£ + </entry> + </row> + <row> + <entry>3.0.10</entry> + <entry> + ¶Ô <parameter>server</parameter> Ìí¼Ó ":/path/to/socket" Ö§³Ö¡£ + </entry> + </row> + <row> + <entry>3.0.0</entry> + <entry> + ¶Ô <parameter>server</parameter> Ìí¼Ó ":port" Ö§³Ö¡£ + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mysql_connect</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php - $link = mysql_connect("localhost", "mysql_user", "mysql_password") - or die("Could not connect: " . mysql_error()); - print ("Connected successfully"); - mysql_close($link); +$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); +if (!$link) { + die('Could not connect: ' . mysql_error()); +} +echo 'Connected successfully'; +mysql_close($link); ?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>mysql_pconnect</function> ºÍ - <function>mysql_close</function>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Ö»Òª½« server Ö¸¶¨Îª "localhost" »ò + "localhost:port"£¬MySQL ¿Í»§¶Ë¿â»áÔ½¹ý´ËÖµ²¢³¢ÊÔÁ¬½Óµ½±¾µØÌ×½Ó×Ö£¨Windows + ÖеÄÃû×ֹܵÀ£©¡£Èç¹ûÏëÓà TCP/IP£¬Ó¦¸ÃÓà "127.0.0.1" + ´úÌæ "localhost"¡£Èç¹û MySQL ¿Í»§¶Ë¿âÊÔͼÁ¬½Óµ½Ò»¸ö´íÎóµÄ±¾µØÌ×½Ó×Ö£¬ÔòÓ¦¸ÃÔÚ + PHP ÅäÖÃÖÐÉ趨 mysql.default_host µÄÕýȷ·¾¶²¢°Ñ server Áô¿Õ¡£ + </para> + </note> + <note> + <para> + ½Å±¾Ò»½áÊø£¬µ½·þÎñÆ÷µÄÁ¬½Ó¾Í±»¹Ø±Õ£¬³ý·Ç֮ǰÒѾÃ÷È·µ÷Óà + <function>mysql_close</function> ¹Ø±ÕÁË¡£ + </para> + </note> + <note> + <para> + ¿ÉÒÔÔÚº¯ÊýÃûǰ¼ÓÉÏÒ»¸ö + <link linkend="language.operators.errorcontrol">@</link> + À´ÒÖÖÆ³ö´íʱµÄ´íÎóÐÅÏ¢¡£ + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>mysql_pconnect</function></member> + <member><function>mysql_close</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: