Saturday, 24 August 2013

If MULTIPLE is enabled for , how is searching based on that field affected?

If MULTIPLE is enabled for , how is searching based on that field affected?

In my question in Unexpected entry in a <select> field! How did this
happen? , I had asked about an unexpected 01,05 entry in a field that
stored values from a <FORM><SELECT>. The input did not have MULTIPLE
enabled and should have had the default of single select.
Yet it allowed a user to make multiple selections. I have now realized
that in my current scenario, there are several users who would need to
select more than one option. So now I am faced with another question.
What if, I were to need to query the database for values in that same
field? Would multiple entries stored in the field screw up the results?
Let us say that the <SELECT> asked the user to select between 01 and 04.
My expectation would be that the field will store either 01, or 02, or 03,
or 04 and I might query the table to return all rows that contained '02'.
What if one of the users has made multiple selections - say 02 and 04. In
the database there would now be an entry like 02,04 in that field. If I
were to query for 02 (or 04 for that matter), would I get the 02,04 entry
in the result along with the ones that contained only '02' in that column?
What are the conditions under which I could face a select query that did
not return all the rows I need?

No comments:

Post a Comment