title: Query Result: What is $row[0]
body: <p>I know this may sound like a stupid question from a programming-newbie, but I just want to make sure I understand correctly.</p>
  
  <p>After a query, what does <code>$row[0]</code> stand for/ result in?</p>
  
  <p>Is my understanding correct that <code>$row[0]</code> shows ALL results?</p>
  
  <p>HERE ARE EXAMPLES:</p>
  
  <pre><code>$query = "SELECT count(commentid) from comments where jokeid = $jokeid";
  
  $result = mysql_query($query);
  
  $row=mysql_fetch_array($result);
  
  if ($row[0] == 0)
  
  {
  
     echo "No comments posted yet.&amp;nbsp;&amp;nbsp;\n";
  
  
  
  } else
  
  {
  
     echo $row[0] . "\n";
     echo "&amp;nbsp;comments posted.&amp;nbsp;&amp;nbsp;\n";
  </code></pre>
  
  <p>AND THIS ONE</p>
  
  <pre><code>$query = "Select count(prodid) from products where catid = $catid";
        $result = mysql_query($query);
        $row = mysql_fetch_array($result);
        if ($row[0] == 0)
        {
           echo "&lt;h2&gt;&lt;br&gt;Sorry, there are no products in this category&lt;/h2&gt;\n";
        }
        else
        {
           $totrecords = $row[0];
  </code></pre>
  
  <p>Thanks in advance.</p>