$res = $res->result;
}
Wikimedia\suppressWarnings();
- $n = $res ? $this->mysqlNumRows( $res ) : 0;
+ $n = !is_bool( $res ) ? $this->mysqlNumRows( $res ) : 0;
Wikimedia\restoreWarnings();
// Unfortunately, mysql_num_rows does not reset the last errno.
public function fetchRow( $res );
/**
- * Get the number of rows in a result object
+ * Get the number of rows in a query result. If the query did not return
+ * any rows (for example, if it was a write query), this returns zero.
*
* @param mixed $res A SQL result
* @return int