cvs: phpdoc-zh /reference/mysql/functions mysql-fetch-array.xml mysql-fetch-assoc.xml mysql-fetch-field.xml
| From: | Dallas Thunder | Date: | Wed, 26 Feb 2003 08:31:30 +0000 |
| Subject: | cvs: phpdoc-zh /reference/mysql/functions mysql-fetch-array.xml mysql-fetch-assoc.xml mysql-fetch-field.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1142@lists.php.net to get a copy of this message | ||
dallas Wed Feb 26 03:31:30 2003 EDT
Added files:
/phpdoc-zh/reference/mysql/functions mysql-fetch-assoc.xml
mysql-fetch-field.xml
Modified files:
/phpdoc-zh/reference/mysql/functions mysql-fetch-array.xml
Log:
Completed.
Index: phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml:1.1 phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml:1.2 --- phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml:1.1 Wed Feb 26 02:51:37 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml Wed Feb 26 03:31:23 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.mysql-fetch-array"> @@ -19,7 +19,7 @@ </parameter></methodparam> </methodsynopsis> <para> - ·µ»Ø¸ù¾ÝÈ¡µÃµÄÐÐÉú³ÉµÄÊý×飬Èç¹ûûÓиü¶àÐÐÔò·µ»Ø &false;¡£ + ·µ»Ø¸ù¾Ý´Ó½á¹û¼¯È¡µÃµÄÐÐÉú³ÉµÄÊý×飬Èç¹ûûÓиü¶àÐÐÔò·µ»Ø &false;¡£ </para> <para> <function>mysql_fetch_array</function> ÊÇ @@ -27,8 +27,7 @@ µÄÀ©Õ¹°æ±¾¡£³ýÁ˽«Êý¾ÝÒÔÊý×ÖË÷Òý·½Ê½´¢´æÔÚÊý×éÖÐÖ®Í⣬»¹¿ÉÒÔ½«Êý¾Ý×÷Ϊ¹ØÁªË÷Òý´¢´æ£¬ÓÃ×Ö¶ÎÃû×÷Ϊ¼üÃû¡£ </para> <para> - Èç¹û½á¹ûÖеÄÁ½¸ö»òÒÔÉϵÄÁоßÓÐÏàͬ×Ö¶ÎÃû£¬×îºóÒ»Áн«ÓÅÏÈ¡£Òª·ÃÎÊͬÃûµÄÆäËüÁУ¬±ØÐëÓøÃÁеÄÊý×ÖË÷Òý - »ò¸ø¸ÃÁÐÆð¸ö±ðÃû¡£¶ÔÓбðÃûµÄÁУ¬²»ÄÜÔÙÓÃÔÀ´µÄÁÐÃû·ÃÎÊÆäÄÚÈÝ£¨±¾ÀýÖÐµÄ + Èç¹û½á¹ûÖеÄÁ½¸ö»òÒÔÉϵÄÁоßÓÐÏàͬ×Ö¶ÎÃû£¬×îºóÒ»Áн«ÓÅÏÈ¡£Òª·ÃÎÊͬÃûµÄÆäËüÁУ¬±ØÐëÓøÃÁеÄÊý×ÖË÷Òý»ò¸ø¸ÃÁÐÆð¸ö±ðÃû¡£¶ÔÓбðÃûµÄÁУ¬²»ÄÜÔÙÓÃÔÀ´µÄÁÐÃû·ÃÎÊÆäÄÚÈÝ£¨±¾ÀýÖÐµÄ <literal>'field'</literal>£©¡£ <example> <title>Ïàͬ×Ö¶ÎÃûµÄ²éѯ</title> Index: phpdoc-zh/reference/mysql/functions/mysql-fetch-assoc.xml +++ phpdoc-zh/reference/mysql/functions/mysql-fetch-assoc.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.mysql-fetch-assoc"> <refnamediv> <refname>mysql_fetch_assoc</refname> <refpurpose> ´Ó½á¹û¼¯ÖÐÈ¡µÃÒ»ÐÐ×÷Ϊ¹ØÁªÊý×é </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>array</type><methodname>mysql_fetch_assoc</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> ·µ»Ø¸ù¾Ý´Ó½á¹û¼¯È¡µÃµÄÐÐÉú³ÉµÄ¹ØÁªÊý×飬Èç¹ûûÓиü¶àÐÐÔò·µ»Ø &false;¡£ </para> <para> <function>mysql_fetch_assoc</function> ºÍÓà <function>mysql_fetch_array</function> ¼ÓÉϵڶþ¸ö¿ÉÑ¡²ÎÊý MYSQL_ASSOC ÍêÈ«Ïàͬ¡£Ëü½ö½ö·µ»Ø¹ØÁªÊý×é¡£ÕâÒ²ÊÇ <function>mysql_fetch_array</function> Æð³õʼµÄ¹¤×÷·½Ê½¡£Èç¹ûÔÚ¹ØÁªË÷ÒýÖ®Í⻹ÐèÒªÊý×ÖË÷Òý£¬Óà <function>mysql_fetch_array</function>¡£ </para> <para> Èç¹û½á¹ûÖеÄÁ½¸ö»òÒÔÉϵÄÁоßÓÐÏàͬ×Ö¶ÎÃû£¬×îºóÒ»Áн«ÓÅÏÈ¡£Òª·ÃÎÊͬÃûµÄÆäËüÁУ¬ÒªÃ´Óà <function>mysql_fetch_row</function> À´È¡µÃÊý×ÖË÷Òý»ò¸ø¸ÃÁÐÆð¸ö±ðÃû¡£²Î¼û <function>mysql_fetch_array</function> Àý×ÓÖÐÓйرðÃû˵Ã÷¡£ </para> <para> ÓÐÒ»µãºÜÖØÒª±ØÐëÖ¸³ö£¬Óà <function>mysql_fetch_assoc</function> ²¢<emphasis>²»Ã÷ÏÔ</emphasis> ±ÈÓà <function>mysql_fetch_row</function> Âý£¬¶øÇÒ»¹ÌṩÁËÃ÷ÏÔ¸ü¶àµÄÖµ¡£ </para> <example> <title>À©Õ¹µÄ <function>mysql_fetch_assoc</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php $conn = mysql_connect("localhost", "mysql_user", "mysql_password"); if (!$conn) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("mydbname")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $sql = "SELECT id as userid, fullname, userstatus FROM sometable WHERE userstatus = 1"; $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } // While a row of data exists, put that row in $row as an associative array // Note: If you're expecting just one row, no need to use a loop // Note: If you put extract($row); inside the following loop, you'll // then create $userid, $fullname, and $userstatus while ($row = mysql_fetch_assoc($result)) { echo $row["userid"]; echo $row["fullname"]; echo $row["userstatus"]; } mysql_free_result($result); ?> ]]> </programlisting> </example> <para> ²Î¼û <function>mysql_fetch_row</function>£¬<function>mysql_fetch_array</function>£¬<function>mysql_query</function> ºÍ <function>mysql_error</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-fetch-field.xml +++ phpdoc-zh/reference/mysql/functions/mysql-fetch-field.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.mysql-fetch-field"> <refnamediv> <refname>mysql_fetch_field</refname> <refpurpose> ´Ó½á¹û¼¯ÖÐÈ¡µÃÁÐÐÅÏ¢²¢×÷Ϊ¶ÔÏó·µ»Ø </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>object</type><methodname>mysql_fetch_field</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter> field_offset </parameter></methodparam> </methodsynopsis> <para> ·µ»ØÒ»¸ö°üº¬×Ö¶ÎÐÅÏ¢µÄ¶ÔÏó¡£ </para> <para> <function>mysql_fetch_field</function> ¿ÉÒÔÓÃÀ´´Óij¸ö²éѯ½á¹ûÖÐÈ¡µÃ×ֶεÄÐÅÏ¢¡£Èç¹ûûÓÐÖ¸¶¨×Ö¶ÎÆ«ÒÆÁ¿£¬ÔòÏÂÒ»¸öÉÐδ±» <function>mysql_fetch_field</function> È¡µÃµÄ×ֶα»ÌáÈ¡¡£ </para> <para> ¶ÔÏóµÄÊôÐÔΪ£º <itemizedlist> <listitem> <simpara> name - ÁÐÃû </simpara> </listitem> <listitem> <simpara> table - ¸ÃÁÐËùÔڵıíÃû </simpara> </listitem> <listitem> <simpara> max_length - ¸ÃÁÐ×î´ó³¤¶È </simpara> </listitem> <listitem> <simpara> not_null - 1£¬Èç¹û¸ÃÁв»ÄÜΪ &null; </simpara> </listitem> <listitem> <simpara> primary_key - 1£¬Èç¹û¸ÃÁÐÊÇ primary key </simpara> </listitem> <listitem> <simpara> unique_key - 1£¬Èç¹û¸ÃÁÐÊÇ unique key </simpara> </listitem> <listitem> <simpara> multiple_key - 1£¬Èç¹û¸ÃÁÐÊÇ non-unique key </simpara> </listitem> <listitem> <simpara> numeric - 1£¬Èç¹û¸ÃÁÐÊÇ numeric </simpara> </listitem> <listitem> <simpara> blob - 1£¬Èç¹û¸ÃÁÐÊÇ BLOB </simpara> </listitem> <listitem> <simpara> type - ¸ÃÁеÄÀàÐÍ </simpara> </listitem> <listitem> <simpara> unsigned - 1£¬Èç¹û¸ÃÁÐÊÇÎÞ·ûºÅÊý </simpara> </listitem> <listitem> <simpara> zerofill - 1£¬Èç¹û¸ÃÁÐÊÇ zero-filled </simpara> </listitem> </itemizedlist> </para> <example> <title><function>mysql_fetch_field</function></title> <programlisting role="php"> <![CDATA[ <?php mysql_connect('localhost:3306', $user, $password) or die("Could not connect: " . mysql_error()); mysql_select_db("database"); $result = mysql_query("select * from table") or die("Query failed: " . mysql_error()); /* get column metadata */ $i = 0; while ($i < mysql_num_fields($result)) { echo "Information for column $i:<br />\n"; $meta = mysql_fetch_field($result); if (!$meta) { echo "No information available<br />\n"; } echo "<pre> blob: $meta->blob max_length: $meta->max_length multiple_key: $meta->multiple_key name: $meta->name not_null: $meta->not_null numeric: $meta->numeric primary_key: $meta->primary_key table: $meta->table type: $meta->type unique_key: $meta->unique_key unsigned: $meta->unsigned zerofill: $meta->zerofill </pre>"; $i++; } mysql_free_result($result); ?> ]]> </programlisting> </example> <para> ²Î¼ûo <function>mysql_field_seek</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-fetch-array.xml diff -u phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml:1.1 phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml:1.2 --- phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml:1.1 Wed Feb 26 02:51:37 2003 +++ phpdoc-zh/reference/mysql/functions/mysql-fetch-array.xml Wed Feb 26 03:31:23 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.mysql-fetch-array"> @@ -19,7 +19,7 @@ </parameter></methodparam> </methodsynopsis> <para> - ·µ»Ø¸ù¾ÝÈ¡µÃµÄÐÐÉú³ÉµÄÊý×飬Èç¹ûûÓиü¶àÐÐÔò·µ»Ø &false;¡£ + ·µ»Ø¸ù¾Ý´Ó½á¹û¼¯È¡µÃµÄÐÐÉú³ÉµÄÊý×飬Èç¹ûûÓиü¶àÐÐÔò·µ»Ø &false;¡£ </para> <para> <function>mysql_fetch_array</function> ÊÇ @@ -27,8 +27,7 @@ µÄÀ©Õ¹°æ±¾¡£³ýÁ˽«Êý¾ÝÒÔÊý×ÖË÷Òý·½Ê½´¢´æÔÚÊý×éÖÐÖ®Í⣬»¹¿ÉÒÔ½«Êý¾Ý×÷Ϊ¹ØÁªË÷Òý´¢´æ£¬ÓÃ×Ö¶ÎÃû×÷Ϊ¼üÃû¡£ </para> <para> - Èç¹û½á¹ûÖеÄÁ½¸ö»òÒÔÉϵÄÁоßÓÐÏàͬ×Ö¶ÎÃû£¬×îºóÒ»Áн«ÓÅÏÈ¡£Òª·ÃÎÊͬÃûµÄÆäËüÁУ¬±ØÐëÓøÃÁеÄÊý×ÖË÷Òý - »ò¸ø¸ÃÁÐÆð¸ö±ðÃû¡£¶ÔÓбðÃûµÄÁУ¬²»ÄÜÔÙÓÃÔÀ´µÄÁÐÃû·ÃÎÊÆäÄÚÈÝ£¨±¾ÀýÖÐµÄ + Èç¹û½á¹ûÖеÄÁ½¸ö»òÒÔÉϵÄÁоßÓÐÏàͬ×Ö¶ÎÃû£¬×îºóÒ»Áн«ÓÅÏÈ¡£Òª·ÃÎÊͬÃûµÄÆäËüÁУ¬±ØÐëÓøÃÁеÄÊý×ÖË÷Òý»ò¸ø¸ÃÁÐÆð¸ö±ðÃû¡£¶ÔÓбðÃûµÄÁУ¬²»ÄÜÔÙÓÃÔÀ´µÄÁÐÃû·ÃÎÊÆäÄÚÈÝ£¨±¾ÀýÖÐµÄ <literal>'field'</literal>£©¡£ <example> <title>Ïàͬ×Ö¶ÎÃûµÄ²éѯ</title> Index: phpdoc-zh/reference/mysql/functions/mysql-fetch-assoc.xml +++ phpdoc-zh/reference/mysql/functions/mysql-fetch-assoc.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.mysql-fetch-assoc"> <refnamediv> <refname>mysql_fetch_assoc</refname> <refpurpose> ´Ó½á¹û¼¯ÖÐÈ¡µÃÒ»ÐÐ×÷Ϊ¹ØÁªÊý×é </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>array</type><methodname>mysql_fetch_assoc</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> ·µ»Ø¸ù¾Ý´Ó½á¹û¼¯È¡µÃµÄÐÐÉú³ÉµÄ¹ØÁªÊý×飬Èç¹ûûÓиü¶àÐÐÔò·µ»Ø &false;¡£ </para> <para> <function>mysql_fetch_assoc</function> ºÍÓà <function>mysql_fetch_array</function> ¼ÓÉϵڶþ¸ö¿ÉÑ¡²ÎÊý MYSQL_ASSOC ÍêÈ«Ïàͬ¡£Ëü½ö½ö·µ»Ø¹ØÁªÊý×é¡£ÕâÒ²ÊÇ <function>mysql_fetch_array</function> Æð³õʼµÄ¹¤×÷·½Ê½¡£Èç¹ûÔÚ¹ØÁªË÷ÒýÖ®Í⻹ÐèÒªÊý×ÖË÷Òý£¬Óà <function>mysql_fetch_array</function>¡£ </para> <para> Èç¹û½á¹ûÖеÄÁ½¸ö»òÒÔÉϵÄÁоßÓÐÏàͬ×Ö¶ÎÃû£¬×îºóÒ»Áн«ÓÅÏÈ¡£Òª·ÃÎÊͬÃûµÄÆäËüÁУ¬ÒªÃ´Óà <function>mysql_fetch_row</function> À´È¡µÃÊý×ÖË÷Òý»ò¸ø¸ÃÁÐÆð¸ö±ðÃû¡£²Î¼û <function>mysql_fetch_array</function> Àý×ÓÖÐÓйرðÃû˵Ã÷¡£ </para> <para> ÓÐÒ»µãºÜÖØÒª±ØÐëÖ¸³ö£¬Óà <function>mysql_fetch_assoc</function> ²¢<emphasis>²»Ã÷ÏÔ</emphasis> ±ÈÓà <function>mysql_fetch_row</function> Âý£¬¶øÇÒ»¹ÌṩÁËÃ÷ÏÔ¸ü¶àµÄÖµ¡£ </para> <example> <title>À©Õ¹µÄ <function>mysql_fetch_assoc</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php $conn = mysql_connect("localhost", "mysql_user", "mysql_password"); if (!$conn) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("mydbname")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $sql = "SELECT id as userid, fullname, userstatus FROM sometable WHERE userstatus = 1"; $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } // While a row of data exists, put that row in $row as an associative array // Note: If you're expecting just one row, no need to use a loop // Note: If you put extract($row); inside the following loop, you'll // then create $userid, $fullname, and $userstatus while ($row = mysql_fetch_assoc($result)) { echo $row["userid"]; echo $row["fullname"]; echo $row["userstatus"]; } mysql_free_result($result); ?> ]]> </programlisting> </example> <para> ²Î¼û <function>mysql_fetch_row</function>£¬<function>mysql_fetch_array</function>£¬<function>mysql_query</function> ºÍ <function>mysql_error</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-fetch-field.xml +++ phpdoc-zh/reference/mysql/functions/mysql-fetch-field.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.mysql-fetch-field"> <refnamediv> <refname>mysql_fetch_field</refname> <refpurpose> ´Ó½á¹û¼¯ÖÐÈ¡µÃÁÐÐÅÏ¢²¢×÷Ϊ¶ÔÏó·µ»Ø </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>object</type><methodname>mysql_fetch_field</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter> field_offset </parameter></methodparam> </methodsynopsis> <para> ·µ»ØÒ»¸ö°üº¬×Ö¶ÎÐÅÏ¢µÄ¶ÔÏó¡£ </para> <para> <function>mysql_fetch_field</function> ¿ÉÒÔÓÃÀ´´Óij¸ö²éѯ½á¹ûÖÐÈ¡µÃ×ֶεÄÐÅÏ¢¡£Èç¹ûûÓÐÖ¸¶¨×Ö¶ÎÆ«ÒÆÁ¿£¬ÔòÏÂÒ»¸öÉÐδ±» <function>mysql_fetch_field</function> È¡µÃµÄ×ֶα»ÌáÈ¡¡£ </para> <para> ¶ÔÏóµÄÊôÐÔΪ£º <itemizedlist> <listitem> <simpara> name - ÁÐÃû </simpara> </listitem> <listitem> <simpara> table - ¸ÃÁÐËùÔڵıíÃû </simpara> </listitem> <listitem> <simpara> max_length - ¸ÃÁÐ×î´ó³¤¶È </simpara> </listitem> <listitem> <simpara> not_null - 1£¬Èç¹û¸ÃÁв»ÄÜΪ &null; </simpara> </listitem> <listitem> <simpara> primary_key - 1£¬Èç¹û¸ÃÁÐÊÇ primary key </simpara> </listitem> <listitem> <simpara> unique_key - 1£¬Èç¹û¸ÃÁÐÊÇ unique key </simpara> </listitem> <listitem> <simpara> multiple_key - 1£¬Èç¹û¸ÃÁÐÊÇ non-unique key </simpara> </listitem> <listitem> <simpara> numeric - 1£¬Èç¹û¸ÃÁÐÊÇ numeric </simpara> </listitem> <listitem> <simpara> blob - 1£¬Èç¹û¸ÃÁÐÊÇ BLOB </simpara> </listitem> <listitem> <simpara> type - ¸ÃÁеÄÀàÐÍ </simpara> </listitem> <listitem> <simpara> unsigned - 1£¬Èç¹û¸ÃÁÐÊÇÎÞ·ûºÅÊý </simpara> </listitem> <listitem> <simpara> zerofill - 1£¬Èç¹û¸ÃÁÐÊÇ zero-filled </simpara> </listitem> </itemizedlist> </para> <example> <title><function>mysql_fetch_field</function></title> <programlisting role="php"> <![CDATA[ <?php mysql_connect('localhost:3306', $user, $password) or die("Could not connect: " . mysql_error()); mysql_select_db("database"); $result = mysql_query("select * from table") or die("Query failed: " . mysql_error()); /* get column metadata */ $i = 0; while ($i < mysql_num_fields($result)) { echo "Information for column $i:<br />\n"; $meta = mysql_fetch_field($result); if (!$meta) { echo "No information available<br />\n"; } echo "<pre> blob: $meta->blob max_length: $meta->max_length multiple_key: $meta->multiple_key name: $meta->name not_null: $meta->not_null numeric: $meta->numeric primary_key: $meta->primary_key table: $meta->table type: $meta->type unique_key: $meta->unique_key unsigned: $meta->unsigned zerofill: $meta->zerofill </pre>"; $i++; } mysql_free_result($result); ?> ]]> </programlisting> </example> <para> ²Î¼ûo <function>mysql_field_seek</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 -->