php - If MULTIPLE is enabled for <SELECT>, how is searching based on that field affected? -
in question in unexpected entry in <select> field! how did happen? , had asked unexpected 01,05
entry in field stored values <form><select>
. input did not have multiple enabled , should have had default of single select.
yet allowed user make multiple selections. have realized in current scenario, there several users need select more 1 option. faced question.
what if, need query database values in same field? multiple entries stored in field screw results?
let <select>
asked user select between 01 , 04. expectation field store either 01, or 02, or 03, or 04 , might query table return rows contained '02'.
what if 1 of users has made multiple selections - 02 , 04. in database there entry 02,04 in field. if query 02 (or 04 matter), 02,04 entry in result along ones contained '02' in column?
what conditions under face select query did not return rows need?
you can use mysql in clause check whether value found inside list of values.
a better approach perhaps, employ single-to-many relationship table. (look up)
Comments
Post a Comment