Made a database function dbHaveEvents()