【发布时间】:2012-03-12 01:42:21
【问题描述】:
我不是专家,所以如果您能具体回答,我将不胜感激。
我有这个注册表单,其中有一个包含很多复选框的部分,我想知道将其保存在数据库中的最佳方法是什么。我不确定是否所有值都应该放在一个列中,或者我是否应该仅为我的注册表单的这一部分创建一个不同的表。同样重要的是要考虑到我稍后需要从数据库中提取所有这些数据并将其显示在“管理后端”中,以供编辑以更新数据库。您可以在下面看到包含复选框的部分的部分 html 代码。
<p>4) Please select only the product(s) you are interested in. (Anticipated purchase amounts for the quarter.)</p>
<table cellpadding="15" >
<tbody>
<tr>
<th>Handbags</th>
<th>Fashion Jewelry</th>
<th>Watches</th>
<th>Crystal Travel Jewelry</th>
<th>Fine Jewelry</th>
</tr>
<tr>
<td>
<input type="checkbox" name="pro_amount[]" value="1" />$2500+ </br>
<input type="checkbox" name="pro_amount[]" value="2" />$1000-$2500 </br>
<input type="checkbox" name="pro_amount[]" value="3" />Up to $1000 </br>
</td>
<td>
<input type="checkbox" name="pro_amount[]" value="4" />$2500+ </br>
<input type="checkbox" name="pro_amount[]" value="5" />$1000-$2500 </br>
<input type="checkbox" name="pro_amount[]" value="6" />Up to $1000 </br>
<td>
<input type="checkbox" name="pro_amount[]" value="7" />$2500+ </br>
<input type="checkbox" name="pro_amount[]" value="8" />$1000-$2500 </br>
<input type="checkbox" name="pro_amount[]" value="9" />Up to $1000 </br>
<td>
<input type="checkbox" name="pro_amount[]" value="10" />$2500+ </br>
<input type="checkbox" name="pro_amount[]" value="11" />$1000-$2500 </br>
<input type="checkbox" name="pro_amount[]" value="12" />Up to $1000 </br>
<td>
<input type="checkbox" name="pro_amount[]" value="13" />$2500+ </br>
<input type="checkbox" name="pro_amount[]" value="14" />$1000-$2500 </br>
<input type="checkbox" name="pro_amount[]" value="15" />Up to $1000 </br>
</tr>
</tbody>
</table>
<p>5) What are the average retail price points for each of the following items? (Check only those that apply.)</p>
<table cellpadding="15" >
<tbody>
<tr>
<th>Handbags</th>
<th>Jewelry</th>
<th>Watches</th>
</tr>
<tr>
<td>
<input type="checkbox" name="av_rtp[]" value="1" />$125 or greater<br>
<input type="checkbox" name="av_rtp[]" value="2" />$75</br>
<input type="checkbox" name="av_rtp[]" value="3" /> $40</br>
</td>
<td>
<input type="checkbox" name="av_rtp[]" value="4" />$125 or greater<br>
<input type="checkbox" name="av_rtp[]" value="5" />$75</br>
<input type="checkbox" name="av_rtp[]" value="6" /> $40</br>
<td>
<input type="checkbox" name="av_rtp[]" value="7" />$125 or greater<br>
<input type="checkbox" name="av_rtp[]" value="8" />$75</br>
<input type="checkbox" name="av_rtp[]" value="9" /> $40</br>
</tr>
</tbody>
</table>
非常感谢您提供的任何帮助。
【问题讨论】:
标签: database database-design database-schema checkbox