Added function and ability for count in mysql, this method is simplified...

... and uses count(*) instead of the find method, which is really slow.

If something is not up to standards, or you would like us to modify before accepting, please let us know.