<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1037794" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1037794</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sql-and-php-problem#comment-1216441</link>
    <description> &lt;p&gt;True, but I believe mysql_fetch_array moans if the result is broken due to invalid SQL, whereas mysql_num_rows just returns &#039;0&#039;. At least, I think so... I was advised to do it this way by a senior developer I know when we were working together on a project - it may just be that I&#039;ve inherited a bad habit!&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Mar 2007 20:23:59 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1216441 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sql-and-php-problem#comment-1216440</link>
    <description> &lt;p&gt;Doesn&#039;t the while loop mean that if there&#039;s zero results, the loop will get execute zero times?&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Mar 2007 19:50:32 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1216440 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sql-and-php-problem#comment-1216432</link>
    <description> &lt;p&gt;personally, I prefer to check if their is a result first, before trying to run through it:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if(mysql_num_rows($result) &amp;gt; 0) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while($row = mysql_fetch_array($result)) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //****whatever&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Mar 2007 18:56:44 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1216432 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sql-and-php-problem#comment-1216408</link>
    <description> &lt;p&gt;You haven&#039;t actually executed the query. You&#039;ve just put it into a string is all. For the second block of code, you&#039;ll need to do something more like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$result = mysql_query($sql);&lt;br /&gt;&lt;br /&gt;while($row = mysql_fetch_array( $result )) {&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Mar 2007 12:55:38 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1216408 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
