Blueimp文件多上传到Mysql

I am using the Blueimp jQuery file uploader to upload to mysql table. I am using the basic ui version. I am using the code found on this page PHP-MySQL-database-integration

When I upload one file at a time, it uploads the correct title and description. When I upload multiple files, it uploads the rows to MySQL fine for file names, but repeats the same data in all MySQL row fields for the title and descriptions.

<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">

//ADDED
    <td>
    <label class="title">
    <span>Title:</span><br>
    <input name="title[]" class="form-control">
    </label>
    </td>
//ADDED
    <td>
    <label class="description">
    <span>Description:</span><br>
    <input name="description[]" class="form-control">
    </label>
    </td>

OK, problem solved. I had the initialization code

$('#fileupload').fileupload({
url: 'server/php/'
}).on('fileuploadsubmit', function (e, data) {
data.formData = data.context.find(':input').serializeArray();
});

in the head of the index upload page and it needed to go in the main.js file