title: PHP: How to check if no rows are returned
body: <p>With the following PHP code, how do i check if there's no row retuned so i can echo some message?</p>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php 
      require_once 'db_conx.php';
      $Result = mysql_query("SELECT * FROM ads WHERE pid = '2'")
          or die (mysql_error());
      while($row = mysql_fetch_array($Result)){
          echo '&lt;span class="classPid" style="display:none"&gt;'.$row['pid'].'&lt;/span&gt;';
      }
  ?&gt;
  </code></pre>
  
  <p>Thanks</p>