value of two drop down as a single field in database


I have two drop downs to select the desired age and i want the value of the two dropdowns to be displayed in a single field in the database. The drop downs are as follows:

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'d_age'); ?&gt;

	&lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'d_age',array('18'=&gt;'18','19'=&gt;'19','20'=&gt;'20','21'=&gt;'21','22'=&gt;'22','23'=&gt;'23','24'=&gt;'24','25'=&gt;'25','26'=&gt;'26')); ?&gt; to  &lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'d_age',array('18'=&gt;'18','19'=&gt;'19','20'=&gt;'20','21'=&gt;'21','22'=&gt;'22','23'=&gt;'23','24'=&gt;'24','25'=&gt;'25','26'=&gt;'26'));?&gt; 

	&lt;?php echo &#036;form-&gt;error(&#036;model,'d_age'); ?&gt;


They are to select the desired age say 18 to 21 and i want it to be stored in the age field as a single value in the database.


So you are asking how to store two values in one field?

That’s up to you… you can use any delimiter you want like “18-21”, “18,21”, “18|21”


In my opinion that is not good… how would you make different selects/calculations if needed… for example if you need to select all users from certain age range…

because of this… it’s better to keep two fields…