您好我想动态添加多个行,我的表单具有相同的字段但不同的表单字段名称(例如city1,city2,city3,... college1,college2,college3 ...)然后所有数据都进入mysql
我试过我的搜索,但没有任何对我有用的是我的代码请帮助我
<div class="form_student_add">
<table class="dd" width="100%" id="data">
<tr>
<td>City</td>
<td>College</td>
<td>Name</td>
</tr>
<tr>
<td>
<select name="city" id="city">
<option selected="selected" value="0">--Select City--</option>
<?php
$sql=mysql_query("select * from tblcities");
while($row=mysql_fetch_array($sql))
{
$id=$row['city_id'];
$data=$row['city_name'];
echo '<option value="'.$id.'">'.$data.'</option>';
}
?>
</select>
</td>
<td>
<select name="college" id="college">
<option selected="selected" value="0">--Select College--</option>
<?php
$sql=mysql_query("select * from tblcollege");
while($row=mysql_fetch_array($sql))
{
$id=$row['college_id'];
$data=$row['college_name'];
echo '<option value="'.$id.'">'.$data.'</option>';
}
?>
</select></td>
<td><input name="full_name" type="text" placeholder="e.g. John Smith" /></td>
</tr>
</table>
<div class="form_btn_videos">
<input type="button" id="id="addTableRow"" name="addnew" value="Add New Part" />
</div>
</div>