Database query method print_warning on Invalid Query