Got the SQL database to properly handle some or conditions