I have been using this little plugin to count a number of things including categories, see http://andersdrengen.dk/projects/catcount/
Ever since I switched to use the latest svn 2.4 this category count didn't work it goes like this
$s = "SELECT COUNT(*) FROM $wpdb->categories"; return $wpdb->get_var($s);
I got database error of no such table wp_categories, don't know why 'wp_' prefix was added while other plugins of same author are still working, e.g counting posts/comments etc.
It was also working fine in 2.3