Мне нужно отправить массив из нескольких записей форм в PHP, чтобы затем вставить его в базу данных MySQL. Я просто не знаю, как это сделать, и я не могу следовать каким-либо другим инструкциям онлайн, поскольку они все отличаются от моих.
//This is the code used to create the array in Jquery of multiple form entries
<script>
$(document).ready(function(){
var called = 0;
ajax_recaller = function(report){
$.ajax({
type: "POST",
data: report[called].serialize(),
url: report[called].attr('action'),
success: function(data) {
called++;
if(called < report.length) {
ajax_recaller(report);
}
else {
called=0;
}
}
});
}
$(document).on('click','.submitforms',function(){
var x=0;
$('.ajax_form').each(function(){
report[x] = $(this);
x++;
});
});
// 'report' is an array of every expense that has been submitted - it now needs to somehow be stored inside the database
});
</script>
Я надеюсь, что произойдет то, что каждый индекс массива может быть отправлен в базу данных mySQL в качестве новой записи