我正在使用一些数据填充html表行,如下面的代码所示!我想允许用户选择这个html表的多行(例如使用复选框但不知道在这种情况下使用复选框)然后我想添加提交按钮,以便用户可以写入所选的html表行到mysql表!(将每行html表写入一个单独的mysql表行)
我应该如何允许用户选择html表行以及如何将多个html表行的数据写入mysql?
<?
$postData_value = $_POST['postData'];
$pieces = explode("\n", $postData_value); // make an array out of curl return value
$pieces = array_map('trim', $pieces); // remove unnecessary space
$pieces = array_chunk($pieces, 2); // group them by two's
?>
<table id="test" cellspacing="0" border="1">
<tr>
<th>variable1 title1</th>
<th>variable2 title2</th>
<th>variable3 title3</th>
<th>variable4 title4</th>
<th>variable5 title5</th>
<th>variable6 title6</th>
<th>variable7 title7</th>
</tr>
<?
foreach($pieces as $key => $value){
.....
.....
.....
echo ("<tr><td>$variable1</td>");
echo ("<td>$variable2</td>");
echo ("<td>$variable3</td>");
echo ("<td>$variable4</td>");
echo ("<td>$variable5</td>");
echo ("<td>$variable6</td>");
echo ("<td>$variable7</td></tr>");
}
?>
</table>