cvs: phpdoc-zh /reference/mysql/functions mysql-real-escape-string.xml mysql-result.xml mysql-select-db.xml mysql-stat.xml mysql-tablename.xml
mysql-thread-id.xml mysql-unbuffered-query.xml

From: Date: Tue, 04 Mar 2003 11:15:35 +0000
Subject: cvs: phpdoc-zh /reference/mysql/functions mysql-real-escape-string.xml mysql-result.xml mysql-select-db.xml mysql-stat.xml mysql-tablename.xml
mysql-thread-id.xml mysql-unbuffered-query.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1172@lists.php.net to get a copy of this message
dallas Tue Mar 4 06:15:35 2003 EDT Added files: /phpdoc-zh/reference/mysql/functions mysql-real-escape-string.xml mysql-result.xml mysql-select-db.xml mysql-stat.xml mysql-tablename.xml mysql-thread-id.xml mysql-unbuffered-query.xml Log: Completed.

Index: phpdoc-zh/reference/mysql/functions/mysql-real-escape-string.xml +++ phpdoc-zh/reference/mysql/functions/mysql-real-escape-string.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.mysql-real-escape-string"> <refnamediv> <refname>mysql_real_escape_string</refname> <refpurpose> תÒå SQL Óï¾äÖÐʹÓõÄ×Ö·û´®ÖеÄÌØÊâ×Ö·û£¬²¢¿¼Âǵ½Á¬½ÓµÄµ±Ç°×Ö·û¼¯ </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>mysql_real_escape_string</methodname> <methodparam><type>string</type><parameter>unescaped_string</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> </methodsynopsis> <para> ±¾º¯Êý½« <parameter>unescaped_string</parameter> ÖеÄÌØÊâ×Ö·ûתÒ壬²¢¼Æ¼°Á¬½ÓµÄµ±Ç°×Ö·û¼¯£¬Òò´Ë¿ÉÒÔ°²È«ÓÃÓÚ <function>mysql_query</function>¡£ </para> <note> <simpara> <function>mysql_real_escape_string</function> ²¢²»×ªÒå <literal>%</literal> ºÍ <literal>_</literal>¡£ </simpara> </note> <example> <title><function>mysql_real_escape_string</function> Àý×Ó</title> <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); ?> ]]> </programlisting> <para> ÒÔÉÏÀý×Ó½«²úÉúÈçÏÂÊä³ö£º <screen> <![CDATA[ Escaped string: Zak\'s and Derick\'s Laptop ]]> </screen> </para> </example> <para> ²Î¼û <function>mysql_escape_string</function> ºÍ <function>mysql_character_set_name</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/mysql/functions/mysql-result.xml +++ phpdoc-zh/reference/mysql/functions/mysql-result.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.mysql-result"> <refnamediv> <refname>mysql_result</refname> <refpurpose>È¡µÃ½á¹ûÊý¾Ý</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>mixed</type><methodname>mysql_result</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>row</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter> field </parameter></methodparam> </methodsynopsis> <para> <function>mysql_result</function> ·µ»Ø MySQL ½á¹û¼¯ÖÐÒ»¸öµ¥ÔªµÄÄÚÈÝ¡£×ֶβÎÊý¿ÉÒÔÊÇ×Ö¶ÎµÄÆ«ÒÆÁ¿»òÕß×Ö¶ÎÃû£¬»òÕßÊÇ×ֶαíµã×Ö¶ÎÃû£¨tablename.fieldname£©¡£Èç¹û¸øÁÐÆðÁ˱ðÃû£¨'select foo as bar from...'£©£¬ÔòÓñðÃûÌæ´úÁÐÃû¡£ </para> <para> µ±×÷ÓÃÓںܴóµÄ½á¹û¼¯Ê±£¬Ó¦¸Ã¿¼ÂÇʹÓÃÄܹ»È¡µÃÕûÐеĺ¯Êý£¨ÔÚϱßÖ¸³ö£©¡£ÕâЩº¯ÊýÔÚÒ»´Îº¯Êýµ÷ÓÃÖзµ»ØÁ˶à¸öµ¥ÔªµÄÄÚÈÝ£¬±È <function>mysql_result</function> ¿ìµÃ¶à¡£´ËÍâ×¢ÒâÔÚ×ֶβÎÊýÖÐÖ¸¶¨Êý×ÖÆ«ÒÆÁ¿±ÈÖ¸¶¨×Ö¶ÎÃû»òÕß tablename.fieldname Òª¿ìµÃ¶à¡£ </para> <para> µ÷Óà <function>mysql_result</function> ²»ÄÜºÍÆäËü´¦Àí½á¹û¼¯µÄº¯Êý»ìºÏµ÷Óᣠ</para> <para> ÍÆ¼öʹÓøßÐÔÄܵÄÌæ´úº¯Êý£º<function>mysql_fetch_row</function>£¬<function>mysql_fetch_array</function> ºÍ <function>mysql_fetch_object</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/mysql/functions/mysql-select-db.xml +++ phpdoc-zh/reference/mysql/functions/mysql-select-db.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.mysql-select-db"> <refnamediv> <refname>mysql_select_db</refname> <refpurpose>Ñ¡Ôñ MySQL Êý¾Ý¿â</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>mysql_select_db</methodname> <methodparam><type>string</type><parameter>database_name</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter> link_identifier </parameter></methodparam> </methodsynopsis> <para> &return.success; </para> <para> <function>mysql_select_db</function> É趨ÓëÖ¸¶¨µÄÁ¬½Ó±êʶ·ûËù¹ØÁªµÄ·þÎñÆ÷Éϵĵ±Ç°¼¤»îÊý¾Ý¿â¡£Èç¹ûûÓÐÖ¸¶¨Á¬½Ó±êʶ·û£¬ÔòʹÓÃÉÏÒ»¸ö´ò¿ªµÄÁ¬½Ó¡£Èç¹ûûÓдò¿ªµÄÁ¬½Ó£¬±¾º¯Êý½«ÎÞ²ÎÊýµ÷Óà <function>mysql_connect</function> À´³¢ÊÔ´ò¿ªÒ»¸ö²¢Ê¹ÓÃÖ®¡£ </para> <para> ÿ¸öÆäºóµÄ <function>mysql_query</function> µ÷Óö¼»á×÷ÓÃÓڻÊý¾Ý¿â¡£ </para> <para> ²Î¼û <function>mysql_connect</function>£¬<function>mysql_pconnect</function> ºÍ <function>mysql_query</function>¡£ </para> <para> ΪÏòϼæÈÝÈÔÈ»¿ÉÒÔʹÓà <function>mysql_selectdb</function>£¬µ«·´¶ÔÕâÑù×ö¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/mysql/functions/mysql-stat.xml +++ phpdoc-zh/reference/mysql/functions/mysql-stat.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.mysql-stat"> <refnamediv> <refname>mysql_stat</refname> <refpurpose>È¡µÃµ±Ç°ÏµÍ³×´Ì¬</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>mysql_stat</methodname> <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> </methodsynopsis> <para> <function>mysql_stat</function> ·µ»Øµ±Ç°·þÎñÆ÷״̬¡£ </para> <note> <para> <function>mysql_stat</function> Ŀǰֻ·µ»Ø uptime£¬threads£¬queries£¬open tables£¬flush tables ºÍ queries per second¡£ÒªµÃµ½ÆäËü״̬±äÁ¿µÄÍêÕûÁÐ±í£¬Ö»ÄÜʹÓà SQL ÃüÁî SHOW STATUS¡£ </para> </note> <para> <example> <title><function>mysql_stat</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php $link = mysql_connect('localhost', "mysql_user", "mysql_password"); $status = explode(' ', mysql_stat($link)); print_r($status); ?> ]]> </programlisting> <para> ÒÔÉÏÀý×Ó½«²úÉúÈçÏÂÊä³ö£º <screen> <![CDATA[ Array ( [0] => Uptime: 5380 [1] => Threads: 2 [2] => Questions: 1321299 [3] => Slow queries: 0 [4] => Opens: 26 [5] => Flush tables: 1 [6] => Open tables: 17 [7] => Queries per second avg: 245.595 ) ]]> </screen> </para> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/mysql/functions/mysql-tablename.xml +++ phpdoc-zh/reference/mysql/functions/mysql-tablename.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.mysql-tablename"> <refnamediv> <refname>mysql_tablename</refname> <refpurpose>È¡µÃ±íÃû</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>mysql_tablename</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>i</parameter></methodparam> </methodsynopsis> <para> <function>mysql_tablename</function> ½ÓÊÜ <function>mysql_list_tables</function> ·µ»ØµÄ½á¹ûÖ¸ÕëÒÔ¼°Ò»¸öÕûÊýË÷Òý×÷Ϊ²ÎÊý²¢·µ»Ø±íÃû¡£¿ÉÒÔÓà <function>mysql_num_rows</function> º¯ÊýÀ´ÅжϽá¹ûÖ¸ÕëÖеıíµÄÊýÄ¿¡£Óà <function>mysql_tablename</function> º¯ÊýÀ´±éÀú´Ë½á¹ûÖ¸Õ룬»òÕßÈκδ¦Àí½á¹û±íµÄº¯Êý£¬ÀýÈç <function>mysql_fetch_array</function>¡£ <example> <title><function>mysql_tablename</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php mysql_connect("localhost", "mysql_user", "mysql_password"); $result = mysql_list_tables("mydb"); for ($i = 0; $i < mysql_num_rows($result); $i++) printf ("Table: %s\n", mysql_tablename($result, $i)); mysql_free_result($result); ?> ]]> </programlisting> </example> </para> <para> ²Î¼û <function>mysql_list_tables</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/mysql/functions/mysql-thread-id.xml +++ phpdoc-zh/reference/mysql/functions/mysql-thread-id.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.mysql-thread-id"> <refnamediv> <refname>mysql_thread_id</refname> <refpurpose>·µ»Øµ±Ç°Ïß³ÌµÄ ID</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>mysql_thread_id</methodname> <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> </methodsynopsis> <para> <function>mysql_thread_id</function> ·µ»Øµ±Ç°Ïß³ÌµÄ ID¡£Èç¹ûÁ¬½Ó¶ªÊ§Á˲¢Óà <function>mysql_ping</function> ÖØÐÂÁ¬½ÓÉÏ£¬Ïß³Ì ID »á¸Ä±ä¡£ÕâÒâζ×Ų»ÄÜÈ¡µÃÏß³ÌµÄ ID ºó±£´æÆðÀ´±¸Óᣵ±ÐèÒªµÄʱºòÔÙÈ¥»ñȡ֮¡£ </para> <example> <title><function>mysql_thread_id</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $thread_id = mysql_thread_id($link); if ($thread_id){ printf ("current thread id is %d\n", $thread_id); } ?> ]]> </programlisting> <para> ÒÔÉÏÀý×Ó½«²úÉúÈçÏÂÊä³ö£º <screen> <![CDATA[ current thread id is 73 ]]> </screen> </para> </example> <para> ²Î¼û <function>mysql_ping</function> ºÍ <function>mysql_list_processes</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/mysql/functions/mysql-unbuffered-query.xml +++ phpdoc-zh/reference/mysql/functions/mysql-unbuffered-query.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.mysql-unbuffered-query"> <refnamediv> <refname>mysql_unbuffered_query</refname> <refpurpose> Ïò MySQL ·¢ËÍÒ»Ìõ SQL ²éѯ£¬²¢²»»ñÈ¡ºÍ»º´æ½á¹ûµÄÐÐ </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>resource</type><methodname>mysql_unbuffered_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>result_mode</parameter></methodparam> </methodsynopsis> <para> <function>mysql_unbuffered_query</function> Ïò MySQL ·¢ËÍÒ»Ìõ SQL ²éѯ <parameter>query</parameter>£¬µ«²»Ïñ <function>mysql_query</function> ÄÇÑù×Ô¶¯»ñÈ¡²¢»º´æ½á¹û¼¯¡£Ò»·½Ã棬ÕâÔÚ´¦ÀíºÜ´óµÄ½á¹û¼¯Ê±»á½ÚÊ¡¿É¹ÛµÄÄÚ´æ¡£ÁíÒ»·½Ã棬¿ÉÒÔÔÚ»ñÈ¡µÚÒ»ÐкóÁ¢¼´¶Ô½á¹û¼¯½øÐвÙ×÷£¬¶ø²»Óõȵ½Õû¸ö SQL Óï¾ä¶¼Ö´ÐÐÍê±Ï¡£µ±Ê¹Óöà¸öÊý¾Ý¿âÁ¬½Óʱ£¬±ØÐëÖ¸¶¨¿ÉÑ¡²ÎÊý <parameter>link_identifier</parameter>¡£ </para> <para> ¿ÉÑ¡µÄ <parameter>result_mode</parameter> ²ÎÊý¿ÉÒÔÊÇ MYSQL_USE_RESULT ºÍ MYSQL_STORE_RESULT¡£Ä¬ÈÏΪ MYSQL_USE_RESULT£¬Òò´Ë½á¹û²»»á±»»º´æ¡£Óë´Ë»¥²¹µÄÐÐΪ²Î¼û <function>mysql_query</function>¡£ </para> <note> <para> <function>mysql_unbuffered_query</function> µÄºÃ´¦ÊÇÓдú¼ÛµÄ£ºÔÚ <function>mysql_unbuffered_query</function> ·µ»ØµÄ½á¹û¼¯Ö®Éϲ»ÄÜʹÓà <function>mysql_num_rows</function>¡£´ËÍâÔÚÏò MySQL ·¢ËÍÒ»ÌõÐ嵀 SQL ²éѯ֮ǰ£¬±ØÐëÌáÈ¡µôËùÓÐ믧´æµÄ SQL ²éѯËù²úÉúµÄ½á¹ûÐС£ </para> </note> <para> ²Î¼û <function>mysql_query</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.doc.zh (#1172) next »