Fixed insert() function in database, Added error handling in pdo mysql to Database