Module broken by drupal core update (mysql_num_rows) So I just updated my Drupal core to the latest (6.2.9) because of the many critical security recommendations.

I have a module which I built and previously, just before the update I had tested the module which uses a hook_cron() function and everything seemed to work as expected. 

After the update It seems completely broken, I keep getting a warning "warning: mysql_num_rows() expects parameter 1 to be resource" which I have read a lot about others having the same problem in other threads, couldn't find a solution which worked, but the thing is, it was literally just working for me!!

I ran the $result query in a shell and it seems to return the expected data, I don't know what the problem suddenly is. All other modules appear to work normally.

function httprequest_cron() {
  $result  = db_query("SELECT nid FROM {httprequest}");
  if (mysql_num_rows($result)) {
  // results returned
  $url = 'http://localhost:3000/blog?status=fetch';
  $result = drupal_http_request($url);
  if (isset($result) &amp;&amp; in_array($result-&gt;code, array('200', '302', '307')) &amp;&amp; $result-&gt;data != '') {
  db_query("DELETE FROM {httprequest} WHERE nid");
  }
  }
  else {
  // no results, but good query
  }
}
You should use db_affected_rows() function of the Drupal instead of mysql_num_rows() function of mysql to check number of rows result from query.

Your code should be:

$result  = db_query("SELECT nid FROM {httprequest}");
    if (db_affected_rows()) {
    //your code
    }


Instead of

$result  = db_query("SELECT nid FROM {httprequest}");
if (mysql_num_rows($result)) {
//your code
}