Custom module block holding DB calls
In theblock_contents you are trying to return php code. Don't. Do not echo or print in it. If anything, build a string. It should look about like that:

/**
* custom html block
* @return string
*/
function theblock_contents() {
  $dbserver="serveradress"; 
  $dblogin="username";       
  $dbpass="dbpassword";     
  $dbname="databaseserver";    

  $result = '';

  mysql_connect($dbserver, $dblogin, $dbpass);
                mysql_select_db($dbname);
                mysql_query("SET NAMES 'utf8'");

  $vypis =  mysql_query("SELECT * FROM characters WHERE (accesslevel &lt; '1') AND (pvpkills &gt; '0') order by pvpkills desc LIMIT 20"); 
  $result .= '&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;center&gt;Nick&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;Kills&lt;/td&gt;&lt;/tr&gt;';
  while($row = mysql_fetch_array($vypis))
  {
    $result .= '&lt;tr&gt;&lt;td&gt;&lt;font color="green"&gt;';
    $result .= $row["char_name"];
    $result .= '&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;font color="blue"&gt;';
    $result .= $row["pvpkills"];
    $result .= '&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;';
  }
  $result .= '&lt;/table&gt;';
  return $result;
}


It's worth to mention that your code was plainly invalid PHP, no matter if it was supposed to run in Drupal or not. You can't simply return PHP code as string and hope it'll be executed. Only the part about not using echo in hooks is really Drupal dependent.

Important note: if you want your modules to work stable, please don't use PHP SQL functions directly. Use db_select to obtain data. Connecting to multiple databases is pretty well documented too.