How to store several HTML form fields in one mysql table field?
I want to store several fields from a html form in one table field. Here is the source code for the form. This is only part of the form, the form tags are there. Attached is a screenshot from this part of the form.
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><input class="field checkbox" type="checkbox" value="Automotive" /><label class="choice">Automotive</label></td>
<td> Remark:<input name="rem_app_1" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="Backlights"/><label class="choice">Backlights</label></td>
<td> Remark:<input name="rem_app_2" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="Signage/Traffic lights"/><label class="choice">Signage/Traffic lights</label></td>
<td> Remark:<input name="rem_app_3" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" valu开发者_高级运维e="IR" /><label class="choice">IR</label></td>
<td> Remark:<input name="rem_app_4" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="LED lights"/><label class="choice">LED lights</label></td>
<td> Remark:<input name="rem_app_5" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="Mobile devices"/><label class="choice">Mobile devices</label></td>
<td> Remark:<input name="rem_app_6" type="text" size="50" value=""/></td>
</tr>
</table>
The way it is stored in mysql should be like this, depending on what checkbox the user clicks,e.g.:
Automotive, Remark: blablabla
Backlights, Remark: blubblubblub
Mobile applications, Remark: skdfjasldfkj
Start with adding a name field to those checkboxes. What language are you using for form processing? PHP?
What backend language are you using on your server? Mysql is not a server language itself, but a means to communicate with a database. You need a server language to handle server requests. Check out PHP, ASP.NET, and Django. Arguably, PHP is the easiest to pick up, install, and set up.
Once you have a backend language, you can use that language's Mysql bindings to communicate with your database.
精彩评论