HTML
<form method='post' id='userform' action='arrayvalue.php'>
<input type='checkbox' name='servicevar[]' value='Gst'>Gst<br> <br>
<input type='checkbox' name='activityvar[]' value='Return'>Return<br>
<input type='checkbox' name='pervar[]' value='Monthly'>Monthly<br>
<input type='checkbox' name='pervar[]' value='Yearly'>Yearly<br>
<input type='checkbox' name='activityvar[]' value='Filling'>Filling<br>
<input type='checkbox' name='pervar[]'value='Monthly'>Monthly<br>
<input type='checkbox' name='pervar[]' value='Yearly'>Yearly<br>
<br>
<input type='checkbox' name='arr[2][service]' value='Incometax'>Incometax<br> <br>
<input type='checkbox' name='arr[2][activity][]' value='Return'>Return<br>
<input type='checkbox' name='arr[2][per][]' value='Monthly'>Monthly<br>
<input type='checkbox' name='arr[2][per][]' value='Yearly'>Yearly<br>
<input type='checkbox' name='activityvar[]' value='Filling'>Filling<br>
<input type='checkbox' name='pervar[]'value='Monthly'>Monthly<br>
<input type='checkbox' name='pervar[]' value='Yearly'>Yearly<br>
<input type='checkbox' name='activityvar[]' value='Return'>Revised<br>
<input type='checkbox' name='pervar[]' value='Monthly'>Monthly<br>
<input type='checkbox' name='pervar[]' value='Yearly'>Yearly<br>
<br>
<input type='submit' name="submit" class='buttons'>
</form>
此代码的输出是:-
我将所有这些值存储在映射表中,
我有serviceactivitymap表,其中存储了具有相关活动的服务,
我有activitypermap表,用于存储与周期性相关的活动。
foreach ($_POST['arr'] as $input) {
$servicevalue = $input['service'];
$query2 = mysql_query("insert into mapclientservice(client_id,service_id)values('$firmid','$servicevalue')",$connection);
foreach ($input['activity'] as $activity) {
$servicevalue = $input['service'];
$query3 = mysql_query("insert into mapserviceactivity(service_id,activity_id)values('$servicess','$activity')",$connection);
foreach ($input['timeperiod'] as $period) {
$query4 = mysql_query("insert into mapactivityperodicity(activity_id,perodicity_id)values('$activity','$period')",$connection);
}
}
}
这用于商店服务活动和周期性。 但是当我存储活动和周期性时,就会出现问题,即周期性的值存储不正确。
与所有活动一起存储的所有检查的周期性, 如何定期存储具有适当活动性的