Found the skip if empty... which has stopped the repetition, but no matter what I select, I can't seem to find the right variable for the option table id (tbl_homes) repeated from the rsHomes recordset. It just repeats null or 0. Any direction on what I'm looking for?
<?php
if (isset($_POST["Insert"]) || isset($_POST["Insert_x"])) {
$MultipleInsertConnection = $framework_connect;
$MultipleInsertTable = "rel_images";
$MultipleInsertRedirect = "tbl_images_results.php";
$MultipleInsertCheck = "rel_homes";
$MultipleInsertIdentifier = 'wamultiinsert_1';
for ($mi=0; $mi<sizeof($_POST[$MultipleInsertIdentifier]); $mi++) {
$MultipleInsertCount = $_POST[$MultipleInsertIdentifier][$mi];
if (($MultipleInsertCheck == "" || (isset($_POST[$MultipleInsertCheck.'_'.$MultipleInsertCount]) && $_POST[$MultipleInsertCheck.'_'.$MultipleInsertCount]!=""))) {
$InsertQuery = new WA_MySQLi_Query($MultipleInsertConnection);
$InsertQuery->Action = "insert";
$InsertQuery->Table = $MultipleInsertTable;
$InsertQuery->bindColumn("home_id", "i", "".((isset($_POST["wamultiinsert_1"."_".$MultipleInsertCount]))?$_POST["wamultiinsert_1"."_".$MultipleInsertCount]:"") ."", "WA_IGNORE");
$InsertQuery->bindColumn("image_id", "i", "".$_SESSION['WADA_Insert_tbl_images'] ."", "WA_IGNORE");
$InsertQuery->execute();
}
}
if ($MultipleInsertRedirect) {
if (function_exists("rel2abs")) $MultipleInsertRedirect = rel2abs($MultipleInsertRedirect,dirname(__FILE__));
header("location: " . $MultipleInsertRedirect);
}
}
?>