I have a custom table in the Drupal DB, which I need to retrive and use on a few places on the site I'm creating. And I don't like to run soo much PHP in blocks, so I thought that I could get the table value I need, using PHP in template.php in the theme-dir and then just call the variable from a block, using PHP.
That didn't work.. Why and how should it be done?
template.php:
$sub_count = db_query("SELECT count FROM {sub_count}")->fetchField();
block:
<?php $sub_count; ?>