title: If mysql_num_rows equals to ZERO is NOT working
body: <p>I'm using this code to count rows and trying to do <code>IF num rows equals to ZERO do INSERT if not UPDATE</code> but it doesn't work. </p>
  
  <p>When I use <code>==</code> operator nothing happens. If I use <code>&gt;=</code> operator script inserting the values but running insert query on every refresh and values are duplicating in MySQL table. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>$isexist = mysql_query("select count(*) from wcddl_filehosts where downloadid = '".$download[id]."'");
  
  if (mysql_num_rows($isexist) == 0) {
  mysql_query("insert into wcddl_filehosts (downloadid, rs) values ('".$download[id]."','$totalRS')");
  } else {
  mysql_query("update wcddl_filehosts set rs = '$totalRS' where downloadid = '".$download[id]."'");
  }
  </code></pre>
  
  <p>What's wrong with this?</p>