the problem is that you have added a redirect to the insert behavior:
$WA_redirectURL = "Files_Results.php";
it inserts the first record, then redirects to the Files_Results.php page before it has a chance to insert the other records....
change:
$WA_redirectURL = "Files_Results.php";
to:
$WA_redirectURL = "";
then change this code:
<?php
if(sizeof($_SESSION['uploadedFiles']) > 0) {
unset($_SESSION['uploadedFiles']);
header("Location: ".$WA_redirectURL);
}
?>
to:
<?php
if(sizeof($_SESSION['uploadedFiles']) > 0) {
unset($_SESSION['uploadedFiles']);
header("Location: Files_Results.php");
}
?>
you cant set the redirect in the insert behavior for this, you have to set it manually in the code that unsets the session.
also, in your code, there are blank lines between code blocks, this can cause issues with the redirect happening.
see this post for details:
showthread.php?t=19285