Ternary's in database actions create invalid inputs

Yes, bad example.