<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[mysql_fetch_object,mysql_fetch_array,mysql_fetch_row有什么区别？]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[数据库技术]]></category>
<pubDate>Mon, 31 Mar 2008 08:50:40 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	mysql_fetch_object,mysql_fetch_array,mysql_fetch_row有什么区别？同样是取数据，它们的区别在那里呢？<br/><br/>object mysql_fetch_object ( resource result )<br/><br/>返回根据所取得的行生成的对象，如果没有更多行则返回 FALSE。<br/><br/>这个返回的是一个对象<br/><br/>示例<br/><div class="code"><br/>&lt;?php<br/>mysql_connect(&quot;hostname&quot;, &quot;user&quot;, &quot;password&quot;);<br/>mysql_select_db(&quot;mydb&quot;);<br/>$result = mysql_query(&quot;select `user_id`,`fullname` from mytable&quot;);<br/>while ($row = mysql_fetch_object($result)) &#123;<br/> &nbsp; &nbsp;echo $row-&gt;user_id;<br/> &nbsp; &nbsp;echo $row-&gt;fullname;<br/>&#125;<br/>mysql_free_result($result);<br/>?&gt;<br/></div><br/>mysql_fetch_row -- 从结果集中取得一行作为枚举数组<br/>这个返回的是一个数字索引的数组 例子<br/><div class="code"><br/>&lt;?php<br/>mysql_connect(&quot;hostname&quot;, &quot;user&quot;, &quot;password&quot;);<br/>mysql_select_db(&quot;mydb&quot;);<br/>$result = mysql_query(&quot;select `user_id`,`fullname` from mytable&quot;);<br/>while ($row = mysql_fetch_row($result)) &#123;<br/> &nbsp; &nbsp;echo $row&#91;0&#93;;<br/> &nbsp; &nbsp;echo $row&#91;1&#93;;<br/>&#125;<br/>mysql_free_result($result);<br/>?&gt;<br/></div><br/><br/>mysql_fetch_array -- &nbsp;从结果集中取得一行作为关联数组，或数字数组，或二者兼有<br/>array mysql_fetch_array ( resource result [, int result_type] )<br/>mysql_fetch_array() 中可选的第二个参数 result_type 是一个常量，可以接受以下值：MYSQL_ASSOC，MYSQL_NUM 和 MYSQL_BOTH。本特性是 PHP 3.0.7 起新加的。本参数的默认值是 MYSQL_BOTH。<br/><br/>返回根据从结果集取得的行生成的数组，如果没有更多行则返回 FALSE。<br/><br/><div class="code"><br/>&lt;?php<br/>mysql_connect(&quot;hostname&quot;, &quot;user&quot;, &quot;password&quot;);<br/>mysql_select_db(&quot;mydb&quot;);<br/>$result = mysql_query(&quot;select `user_id`,`fullname` from mytable&quot;);<br/>while ($row = mysql_fetch_array($result,MYSQL_BOTH)) &#123;<br/> &nbsp; &nbsp;echo $row&#91;0&#93;;<br/> &nbsp; &nbsp;echo $row&#91;&#039;user_id&#039;&#93;;<br/> &nbsp; &nbsp;echo $row&#91;1&#93;;<br/> &nbsp; &nbsp;echo $row&#91;&#039;fullname&#039;&#93;;<br/>&#125;<br/>mysql_free_result($result);<br/>?&gt;<br/></div><br/>Tags - <a href="http://www.dzhope.com/tags/%25E6%2595%25B0%25E6%258D%25AE%25E5%25BA%2593/" rel="tag">数据库</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] mysql_fetch_object,mysql_fetch_array,mysql_fetch_row有什么区别？]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>