<TABLE style="WIDTH: 1066pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=1420 border=0 x:str="">
<COLGROUP>
<COL style="WIDTH: 124pt; mso-width-source: userset; mso-width-alt: 5280" width=165></COL>
<COL style="WIDTH: 154pt; mso-width-source: userset; mso-width-alt: 6560" width=205></COL>
<COL style="WIDTH: 544pt; mso-width-source: userset; mso-width-alt: 23200" width=725></COL>
<COL style="WIDTH: 244pt; mso-width-source: userset; mso-width-alt: 10400" width=325></COL></COLGROUP>
<TBODY>
<TR style="HEIGHT: 20.1pt; mso-height-source: userset" height=26>
<TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 20.1pt; BACKGROUND-COLOR: silver" width=165 height=26><FONT face=宋体 color=#333399 size=2><STRONG>说 明</STRONG></FONT></TD>
<TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: silver" width=205><FONT size=2><FONT color=#333399><STRONG><FONT face=宋体>函</FONT><FONT class=font12 face="Courier New"> </FONT><FONT class=font8 face=宋体>数</FONT><FONT class=font12 face="Courier New"> </FONT><FONT class=font8 face=宋体>名</FONT></STRONG></FONT></FONT></TD>
<TD class=xl27 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: silver" width=725><FONT size=2><FONT color=#333399><STRONG><FONT face=宋体>函</FONT><FONT class=font7 face=Georgia> </FONT><FONT class=font8 face=宋体>数</FONT><FONT class=font7 face=Georgia> </FONT><FONT class=font8 face=宋体>详</FONT><FONT class=font7 face=Georgia> </FONT><FONT class=font8 face=宋体>细</FONT></STRONG></FONT></FONT></TD>
<TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: silver" width=325><FONT face=宋体 color=#333399 size=2><STRONG>函 数 说 明</STRONG></FONT></TD></TR>
<TR style="HEIGHT: 36pt; mso-height-source: userset" height=48>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 36pt; BACKGROUND-COLOR: transparent" width=165 height=48><FONT face=宋体 color=#333399 size=2><STRONG>建立数据库连接</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_connect()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])</FONT><FONT class=font6></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>示例:</FONT><FONT class=font6 face=Georgia>$conn = @mysql_connect("localhost", "username", "password") or dir("</FONT><FONT class=font9 face=宋体>不能连接到</FONT><FONT class=font6 face=Georgia>Mysql Server");</FONT></FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=宋体 color=#333399 size=2>使用该连接必须显示的关闭连接</FONT></TD></TR>
<TR style="HEIGHT: 36pt; mso-height-source: userset" height=48>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 36pt; BACKGROUND-COLOR: transparent" width=165 height=48><FONT face=宋体 color=#333399 size=2><STRONG>建立数据库连接</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_pconnect()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_pconnect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])</FONT><FONT class=font6></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>示例:</FONT><FONT class=font6 face=Georgia>$conn = @mysql_pconnect("localhost", "username", "password") or dir("</FONT><FONT class=font9 face=宋体>不能连接到</FONT><FONT class=font6 face=Georgia>Mysql Server");</FONT></FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=宋体 color=#333399 size=2>使用该连接函数不需要显示的关闭连接,它相当于使用了连接池</FONT></TD></TR>
<TR style="HEIGHT: 60pt; mso-height-source: userset" height=80>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 60pt; BACKGROUND-COLOR: transparent" width=165 height=80><FONT face=宋体 color=#333399 size=2><STRONG>关闭数据库连接</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_close()</FONT></STRONG></TD>
<TD class=xl29 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT size=2><FONT color=#333399><FONT face=Georgia>$conn = @mysql_connect("localhost", "username", "password") or die("</FONT><FONT class=font9 face=宋体>不能连接到</FONT></FONT></FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>Mysql Server");@mysql_select_db("MyDatabase") or die("</FONT></FONT><FONT class=font9 face=宋体 color=#333399 size=2>不能选择这个数据库,或数据库不存在</FONT><FONT color=#333399><FONT size=2><FONT class=font6><FONT face=Georgia>");echo "</FONT></FONT><FONT class=font9 face=宋体>你已经连接到</FONT><FONT class=font6 face=Georgia>MyDatabase</FONT><FONT class=font9 face=宋体>数据库</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>";</FONT><FONT class=font10 color=#800000>mysql_close()</FONT><FONT class=font6 color=#333399>;</FONT></FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 48pt; mso-height-source: userset" height=64>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 48pt; BACKGROUND-COLOR: transparent" width=165 height=64><FONT face=宋体 color=#333399 size=2><STRONG>选择数据库</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_select_db()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>boolean mysql_select_db(string db_name [, resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$conn = @mysql_connect("localhost", "username", "password") or die("</FONT></FONT><FONT class=font9 face=宋体 color=#333399 size=2>不能连接到</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>Mysql Server");@mysql_select_db("MyDatabase") or die("</FONT></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>不能选择这个数据库,或数据库不存在</FONT><FONT class=font6 face=Georgia>");</FONT></FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 80.1pt; mso-height-source: userset" height=106>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 80.1pt; BACKGROUND-COLOR: transparent" width=165 height=106><FONT size=2><FONT color=#333399><STRONG><FONT face=宋体>查询</FONT><FONT class=font7 face=Georgia>MySQL</FONT></STRONG></FONT></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_query()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_query (string query, [resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$linkId = @mysql_connect("localhost", "username", "password") or die("</FONT></FONT><FONT class=font9 face=宋体 color=#333399 size=2>不能连接到</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>Mysql Server");@mysql_select_db("MyDatabase") or die("</FONT></FONT><FONT class=font9 face=宋体 color=#333399 size=2>不能选择这个数据库,或者数据库不存在</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>");$query = "select * from MyTable";$result = mysql_query($query);mysql_close();</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>若</FONT><FONT class=font6 face=Georgia>SQL</FONT><FONT class=font9 face=宋体>查询执行成功,则返回资源标识符,失败时返回</FONT><FONT class=font6 face=Georgia>FALSE</FONT><FONT class=font9 face=宋体>。若执行更新成功,则返回</FONT><FONT class=font6 face=Georgia>TRUE</FONT><FONT class=font9 face=宋体>,否则返回</FONT><FONT class=font6 face=Georgia>FALSE</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 69.95pt; mso-height-source: userset" height=93>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 69.95pt; BACKGROUND-COLOR: transparent" width=165 height=93><FONT size=2><FONT color=#333399><STRONG><FONT face=宋体>查询</FONT><FONT class=font7 face=Georgia>MySQL</FONT></STRONG></FONT></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_db_query()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_db_query(string database, string query [, resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$linkId = @mysql_connect("localhost", "username", "password") or die("</FONT></FONT><FONT class=font9 face=宋体 color=#333399 size=2>不能连接到</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>MysqlServer");$query = "select * from MyTable";$result = mysql_db_query("MyDatabase", $query);mysql_close();</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=宋体 color=#333399 size=2>为了使代码清晰,不推荐使用这个函数调用</FONT></TD></TR>
<TR style="HEIGHT: 75pt; mso-height-source: userset" height=100>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 75pt; BACKGROUND-COLOR: transparent" width=165 height=100><FONT face=宋体 color=#333399 size=2><STRONG>获取和显示数据</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_result()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>mixed mysql_result (resource result_set, int row [, mixed field])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id, name from MyTable order by name";$result = mysql_query($query);$c_id = mysql_result($result, 0, "id");$c_name = mysql_result($result, 0, "name");</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=宋体 color=#333399 size=2>最简单、也是效率最低的数据获取函数</FONT></TD></TR>
<TR style="HEIGHT: 80.1pt; mso-height-source: userset" height=106>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 80.1pt; BACKGROUND-COLOR: transparent" width=165 height=106><FONT face=宋体 color=#333399 size=2><STRONG>获取和显示数据</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_fetch_row()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>array mysql_fetch_row (resource result_set)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id, name from MyTable order by name";$result = mysql_query($query);while (list($id, $name) = mysql_fetch_row($result)) {<SPAN style="mso-spacerun: yes"> </SPAN>echo("Name: $name ($id) <br />");}</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>函数从</FONT><FONT class=font6 face=Georgia>result_set</FONT><FONT class=font9 face=宋体>中获取整个数据行,将值放在一个索引数组中。通常会结使</FONT><FONT class=font6 face=Georgia>list()</FONT><FONT class=font9 face=宋体>函数使用</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 110.1pt; mso-height-source: userset" height=146>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 110.1pt; BACKGROUND-COLOR: transparent" width=165 height=146><FONT face=宋体 color=#333399 size=2><STRONG>获取和显示数据</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_fetch_array()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>array mysql_fetch_array (resource result_set [, int result_type])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id, name from MyTable order by name";$result = mysql_query($query);while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {<SPAN style="mso-spacerun: yes"> </SPAN>$id = $row["id"];<SPAN style="mso-spacerun: yes"> </SPAN>$name = $row["name"];<SPAN style="mso-spacerun: yes"> </SPAN>echo "Name: $name ($id) <br />";}</FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2>result_type</FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>的值有:</FONT><FONT face=Georgia><FONT class=font11 color=#800080>MYSQL_ASSOC</FONT><FONT class=font6 color=#333399>: </FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>字段名表示键,字段内容为值</FONT><FONT face=Georgia><FONT class=font11 color=#800080>MYSQL_NUM</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>数值索引数组,操作与</FONT><FONT class=font6 face=Georgia>mysql_fetch_ros()</FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>函数一样</FONT><FONT face=Georgia><FONT class=font11 color=#800080>MYSQL_BOTH</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>即作为关联数组又作为数值索引数组返回。</FONT><FONT class=font6 face=Georgia>result_type</FONT><FONT class=font9 face=宋体>的默认值。</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 36pt; mso-height-source: userset" height=48>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 36pt; BACKGROUND-COLOR: transparent" width=165 height=48><FONT face=宋体 color=#333399 size=2><STRONG>获取和显示数据</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_fetch_assoc()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>array mysql_fetch_assoc (resource result_set)</FONT><FONT class=font6></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>相当于调用</FONT><FONT class=font6 face=Georgia> mysql_fetch_array(resource, MYSQL_ASSOC);</FONT></FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 99.95pt; mso-height-source: userset" height=133>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 99.95pt; BACKGROUND-COLOR: transparent" width=165 height=133><FONT face=宋体 color=#333399 size=2><STRONG>获取和显示数据</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_fetch_object()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>object mysql_fetch_object(resource result_set)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id, name from MyTable order by name";while ($row = mysql_fetch_object($result)) {<SPAN style="mso-spacerun: yes"> </SPAN>$id = $row->id;<SPAN style="mso-spacerun: yes"> </SPAN>$name = $row->name;<SPAN style="mso-spacerun: yes"> </SPAN>echo "Name: $name ($id) <br />";}</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>在操作上与</FONT><FONT class=font6 face=Georgia>mysql_fetch_array()</FONT><FONT class=font9 face=宋体>相同</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 54pt; mso-height-source: userset" height=72>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 54pt; BACKGROUND-COLOR: transparent" width=165 height=72><FONT face=宋体 color=#333399 size=2><STRONG>所选择的记录</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_num_rows()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>int mysql_num_rows(resource result_set)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>#query = "select id, name from MyTable where id > 65";$result = mysql_query($query);echo "</FONT></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>有</FONT><FONT class=font6 face=Georgia>".mysql_num_rows($result)."</FONT><FONT class=font9 face=宋体>条记录的</FONT><FONT class=font6 face=Georgia>ID</FONT><FONT class=font9 face=宋体>大于</FONT><FONT class=font6 face=Georgia>65";</FONT></FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>只在确定</FONT><FONT class=font6 face=Georgia>select</FONT><FONT class=font9 face=宋体>查询所获取的记录数时才有用。</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 60pt; mso-height-source: userset" height=80>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 60pt; BACKGROUND-COLOR: transparent" width=165 height=80><FONT face=宋体 color=#333399 size=2><STRONG>受影响的记录</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_affected_rows()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>int mysql_affected_rows([resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "update MyTable set name='CheneyFu' where id>=5";$result = mysql_query($query);echo "ID</FONT></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>大于等于</FONT><FONT class=font6 face=Georgia>5</FONT><FONT class=font9 face=宋体>的名称被更新了的记录数:</FONT><FONT class=font6 face=Georgia>".mysql_affected_rows();</FONT></FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>该函数获取受</FONT><FONT class=font6 face=Georgia>INSERT,UPDATE</FONT><FONT class=font9 face=宋体>或</FONT><FONT class=font6 face=Georgia>DELETE</FONT><FONT class=font9 face=宋体>更新语句影响的行数</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 99.95pt; mso-height-source: userset" height=133>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 99.95pt; BACKGROUND-COLOR: transparent" width=165 height=133><FONT face=宋体 color=#333399 size=2><STRONG>获取数据库列表信息</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_list_dbs()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_list_dbs([resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>mysql_connect("localhost", "username", "password");$dbs = mysql_list_dbs();echo "Databases: <br />";while (list($db) = mysql_fetch_rows($dbs)) {<SPAN style="mso-spacerun: yes"> </SPAN>echo "$db <br />";}</FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 36pt; mso-height-source: userset" height=48>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 36pt; BACKGROUND-COLOR: transparent" width=165 height=48><FONT face=宋体 color=#333399 size=2><STRONG>获取数据库名</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_db_name()</FONT></STRONG></TD>
<TD class=xl30 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"><FONT face=Georgia color=#800000 size=2>string mysql_db_name(resource result_set, integer index)</FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>该函数获取在</FONT><FONT class=font6 face=Georgia>mysql_list_dbs()</FONT><FONT class=font9 face=宋体>所返回</FONT><FONT class=font6 face=Georgia>result_set</FONT><FONT class=font9 face=宋体>中位于指定</FONT><FONT class=font6 face=Georgia>index</FONT><FONT class=font9 face=宋体>索引的数据库名</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 80.1pt; mso-height-source: userset" height=106>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 80.1pt; BACKGROUND-COLOR: transparent" width=165 height=106><FONT face=宋体 color=#333399 size=2><STRONG>获取数据库表列表</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_list_tables()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_list_tables(string database [, resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>mysql_connect("localhost", "username", "password");$tables = mysql_list_tables("MyDatabase");while (list($table) = mysql_fetch_row($tables)) {<SPAN style="mso-spacerun: yes"> </SPAN>echo "$table <br />";}</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>该函数获取</FONT><FONT class=font6 face=Georgia>database</FONT><FONT class=font9 face=宋体>中所有表的表名</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 99.95pt; mso-height-source: userset" height=133>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 99.95pt; BACKGROUND-COLOR: transparent" width=165 height=133><FONT face=宋体 color=#333399 size=2><STRONG>获取数据库表名</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_tablename()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>string mysql_tablename(resource result_set, integer index)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>mysql_connect("localhost", "username", "password");$tables = mysql_list_tables("MyDatabase");$count = -1;while (++$count < mysql_numrows($tables)) {<SPAN style="mso-spacerun: yes"> </SPAN>echo mysql_tablename($tables, $count)."<br />";}</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT size=2><FONT color=#333399><FONT face=宋体>该函数获取</FONT><FONT class=font6 face=Georgia>mysql_list_tables()</FONT><FONT class=font9 face=宋体>所返回</FONT><FONT class=font6 face=Georgia>result_set</FONT><FONT class=font9 face=宋体>中位于指定</FONT><FONT class=font6 face=Georgia>index</FONT><FONT class=font9 face=宋体>索引的表名</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 180pt; mso-height-source: userset" height=240>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 180pt; BACKGROUND-COLOR: transparent" width=165 height=240><FONT face=宋体 color=#333399 size=2><STRONG>获取字段信息</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_fetch_field()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>object mysql_fetch_field(resource result [, int field_offset])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>mysql_connect("localhost", "username", "password");mysql_select_db("MyDatabase");$query = "select * from MyTable";$result = mysql_query($query);$fields = mysql_num_fields($result);for($count = 0; $count < $fieds; $count++) {<SPAN style="mso-spacerun: yes"> </SPAN>$field = mysql_fetch_field($result, $count);<SPAN style="mso-spacerun: yes"> </SPAN>echo "<p>$field->name<SPAN style="mso-spacerun: yes"> </SPAN>$field->type<SPAN style="mso-spacerun: yes"> </SPAN>($field->max_length) </p>";}</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT color=#333399><FONT size=2><FONT face=宋体>返回的对象共有</FONT><FONT class=font6 face=Georgia>12</FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>个对象属性:</FONT><FONT face=Georgia><FONT class=font11 color=#800080>name</FONT><FONT class=font6 color=#333399>: </FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>字段名</FONT><FONT face=Georgia><FONT class=font11 color=#800080>table</FONT><FONT class=font6 color=#333399>: </FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>字段所在的表</FONT><FONT face=Georgia><FONT class=font11 color=#800080>max_lengt</FONT><FONT class=font6 color=#333399>h: </FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>字段的最大长度</FONT><FONT face=Georgia><FONT class=font11 color=#800080>not_null</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段不能为</FONT><FONT class=font6 face=Georgia>null</FONT><FONT class=font9 face=宋体>,则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,否则</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>primary_key</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段为主键,则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,否则</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>unique_key</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段是唯一键,则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,</FONT><FONT class=font6 face=Georgia> </FONT><FONT class=font9 face=宋体>否则</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>multiple_key</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段为非唯一,则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,否则</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>numeric</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段为数值则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,否则</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>blob</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段为</FONT><FONT class=font6 face=Georgia>BLOB</FONT><FONT class=font9 face=宋体>则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,否则为</FONT></FONT></FONT><FONT face=Georgia><FONT size=2><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>type</FONT><FONT class=font6 color=#333399>: </FONT></FONT></FONT><FONT size=2><FONT class=font9 face=宋体 color=#333399>字段的数据类型</FONT><FONT face=Georgia><FONT class=font11 color=#800080>unsigned</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段为无符号数则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,否则为</FONT></FONT></FONT><FONT size=2><FONT face=Georgia><FONT class=font6 color=#333399>0</FONT><FONT class=font11 color=#800080>zerofill</FONT><FONT class=font6 color=#333399>: </FONT></FONT><FONT color=#333399><FONT class=font9 face=宋体>如果字段为“零填充”则为</FONT><FONT class=font6 face=Georgia>1</FONT><FONT class=font9 face=宋体>,</FONT><FONT class=font6 face=Georgia> </FONT><FONT class=font9 face=宋体>否则为</FONT><FONT class=font6 face=Georgia>0</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 60pt; mso-height-source: userset" height=80>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 60pt; BACKGROUND-COLOR: transparent" width=165 height=80><FONT face=宋体 color=#333399 size=2><STRONG>获取查询的字段数</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_num_fields()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>integer mysql_num_fields (resource result_set)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id, name from MyTable order by name";$result = mysql_query($query);echo "</FONT></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>这个查询的字段数是:</FONT><FONT class=font6 face=Georgia>".mysql_num_fields($result)."<br />";</FONT></FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=宋体 color=#333399 size=2>返回查询result_set中的字段数</FONT></TD></TR>
<TR style="HEIGHT: 50.1pt; mso-height-source: userset" height=66>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 50.1pt; BACKGROUND-COLOR: transparent" width=165 height=66><FONT face=宋体 color=#333399 size=2><STRONG>获取指定表的所有字段的字段名</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_list_fields()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>resource mysql_list_fields (string database_name, string table_name [, resource link_id])</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$fields = mysql_list_fields("MyDatabase", "MyTable");echo "</FONT></FONT><FONT size=2><FONT color=#333399><FONT class=font9 face=宋体>数据库</FONT><FONT class=font6 face=Georgia>MyDatabase</FONT><FONT class=font9 face=宋体>中表</FONT><FONT class=font6 face=Georgia>MyTable</FONT><FONT class=font9 face=宋体>的字段数:</FONT><FONT class=font6 face=Georgia> ".mysql_num_fields($fields)."<br />";</FONT></FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 20.1pt; mso-height-source: userset" height=26>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 20.1pt; BACKGROUND-COLOR: transparent" width=165 height=26><FONT face=宋体 color=#333399 size=2><STRONG>获取指定的字段选项</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_field_flags()</FONT></STRONG></TD>
<TD class=xl30 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"><FONT face=Georgia color=#800000 size=2>string mysql_field_flags (resource result_set, integer field_offset)</FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 80.1pt; mso-height-source: userset" height=106>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 80.1pt; BACKGROUND-COLOR: transparent" width=165 height=106><FONT face=宋体 color=#333399 size=2><STRONG>获取指定的字段的最大长度</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_field_len()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>integer mysql_field_len (resource result_set, integer field_offset)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select name from MyTable";$result = mysql_query($query);$row = mysql_fetch_row($result);echo mysql_field_len($result, 0)."<br />";</FONT></FONT></TD>
<TD class=xl31 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=宋体 color=#333399 size=2>如果</FONT><FONT size=2><FONT color=#333399><FONT class=font6 face=Georgia>mysql_field_len($reseult, 0) = 16777215</FONT><FONT class=font9 face=宋体>那么</FONT><FONT class=font6 face=Georgia>numer_format(mysql_field_len($result))</FONT><FONT class=font9 face=宋体>等于</FONT><FONT class=font6 face=Georgia>16,777,215</FONT></FONT></FONT></TD></TR>
<TR style="HEIGHT: 69.95pt; mso-height-source: userset" height=93>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 69.95pt; BACKGROUND-COLOR: transparent" width=165 height=93><FONT face=宋体 color=#333399 size=2><STRONG>获取字段名</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_field_name()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>string mysql_field_name (resource result_set, int field_offset)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id as PKID, name from MyTable order by name";$result = mysql_query($query);$row = mysql_fetch_row($result);echo mysql_field_name($result, 0); // Result: PKID</FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 69.95pt; mso-height-source: userset" height=93>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 69.95pt; BACKGROUND-COLOR: transparent" width=165 height=93><FONT face=宋体 color=#333399 size=2><STRONG>获取字段类型</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_field_type()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>string mysql_field_type (resource result_set, int field_offset)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id, name from MyTable order by name";$result = mysql_query($query);$row = mysql_fetch_row($result);echo mysql_field_type($result, 0); // Result: int</FONT></FONT></TD>
<TD class=xl32 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 244pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=325><FONT face=Georgia color=#333399 size=2> </FONT></TD></TR>
<TR style="HEIGHT: 69.95pt; mso-height-source: userset" height=93>
<TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 124pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 69.95pt; BACKGROUND-COLOR: transparent" width=165 height=93><FONT face=宋体 color=#333399 size=2><STRONG>获取字段所在表名</STRONG></FONT></TD>
<TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 154pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=205><STRONG><FONT face="Courier New" color=#333399 size=3>mysql_field_table()</FONT></STRONG></TD>
<TD class=xl28 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-LEFT-COLOR: windowtext; WIDTH: 544pt; BORDER-TOP-COLOR: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=725><FONT face=Georgia color=#800000 size=2>string mysql_field_table (resource result_set, int field_offset)</FONT><FONT class=font6><FONT face=Georgia color=#333399 size=2>$query = "select id as PKID, name from MyTable order by name";$result = mysql_query($query);$row = mysql_fetch_row($result);echo mysql_field_table($result, 0);<SPAN style="mso-spacerun: yes"> </SPAN>// Result: MyTable</FONT></FONT></TD></TR></TBODY></TABLE>