Updated to allow for "ID" or "id" fields (SQL is case sensitive)