I use Drupal 6 and I'm trying to get number of blocks in a region. How is that possible?
The following query returns the number of blocks in the left region of the current theme. Replace left with your region name.
$current_theme = variable_get('theme_default', '');
$number_of_blocks = db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme='%s' AND region='%s'", $current_theme, 'left'));