Webform : how to count and live display results
I looked through the Drupal document from drupalcontrib.org and i saw that there is webform_get_submission_count function to get a count of the total number of submissions for a node. I think you can use that function instead by create a new one.