Run DB query and fetch fields in block--block--ID.tpl.php I need to run Database query and fetch the fields in my block named block--block--45.tpl.php.

How can I get subdomain table field values to my block tpl(block--block--45.tpl.php) file? 

I tried this code in my block tpl file and its not working : $subdomain = db_query("select subdomain from {subdomain} where sid = :sid limit 0, 1", array(":sid" => $node->uid))->fetchField(); 

So anyone suggest an easy way to get subdomain table field values to my block tpl file.
It sounds like you want to enable Tokens on your site and use a token to show the subdomain name in your block, after adjusting the Input Format for the block.

There really isn't coding involved, unless the subdomain module does not provide token support (then implement hook_token_info).