I got for this example 7 checkboxes:
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr style="height: 21px;">
<td style="width: 25%; height: 21px;"><strong>Technologie</strong></td>
<td style="width: 25%; height: 21px;"></td>
<td style="width: 25%; height: 21px;"></td>
<td style="width: 25%; height: 21px;"></td>
</tr>
<tr style="height: 21px;">
<td style="width: 25%; height: 21px;">Tec1</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="1" /> </td>
<td style="width: 25%; height: 21px;">Tec2</td>
<td style="width: 25%; height: 21px;"><input name="Technoloie[]" type="checkbox" value="1" /></td>
</tr>
<tr style="height: 21px;">
<td style="width: 25%; height: 21px;">Tec3</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="1" /> </td>
<td style="width: 25%; height: 21px;"Tec4</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="1" /> </td>
</tr>
<tr style="height: 21px;">
<td style="width: 25%; height: 21px;">Tec5</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="1" /> </td>
<td style="width: 25%; height: 21px;">Tec6</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="1" /> </td>
</tr>
<tr style="height: 21px;">
<td style="width: 25%; height: 21px;"></td>
<td style="width: 25%; height: 21px;">Tec7</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="1" /> </td>
<td style="width: 25%; height: 21px;">Tec8</td>
<td style="width: 25%; height: 21px;"> <input name="Technoloie[]" type="checkbox" value="2" /> </td>
</tr>
</tbody>
</table>
Here is the SQL Table for this Checkbox:
+--------+------+------+------+------+------+------+------+------+------+
| Tec_ID | Tec1 | Tec2 | Tec3 | Tec4 | Tec5 | Tec6 | Tec7 | Tec8 |RanNr |
+--------+------+------+------+------+------+------+------+------+------+
| 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1353 |
| 2 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0000 |
| 3 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1353 |
| 4 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1123 |
| 5 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 2 | 1353 |
| 6 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 2 | 1353 |
| 7 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1993 |
| 8 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1123 |
| 9 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1353 |
| 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1366 |
+--------+------+------+------+------+------+------+------+------+------+
You see already if I check Tec1
and Tec5
, I want to get Tec_ID 1
, so I need a combined checkbox select to get the right ID
and I want to Insert this Primary Key as an foreign key into a other table to handle with the id
in further functions.
But atm I have no idea, how I can handle this in MSSQL and PHP Code? Can someone help?
Original table
FlashID SAP COB SMT BGA TSOP LGA
1 102292 0 1 0 2 0
3 102293 0 1 0 2 0
4 102294 0 1 0 2 0
5 102296 0 1 0 0 1
6 102412 0 1 0 1 0
7 102413 0 1 0 1 0
8 102414 0 1 0 1 0
9 102651 0 1 0 2 0
10 102652 0 1 0 2 0
11 102664 0 1 0 2 0