Added function for MySQL DB