我在http://bootsnipp.com/snippets/OeZkZ#comments
中创建了一个动态表格行我在使用循环插入数据库时遇到问题。
第一行是将字段作为其0 var
{ 1 }
$count = 1;
if(isset($_POST['byMonth']))
{
for( $i = 1; $i <= $count; $i++ )
{
$year = $_POST['year'.$i];
$month = $_POST['month'.$i];
$actual = $_POST['amount'.$i];
//$date = $_POST['entry'.$i];
echo $que = "insert INTO worker_by_month(uid,year,month,actual_amount,date) VALUES ('".$uid."','".$year."','".$month."','".$actual."','".$entry."')";
$mysqli->query($que);
$count = $_POST['items'];
}
}
this is what i have done.