Repeat selection filtered by another recordset
I'm doing a multiple insert and using repeat selection.
I'm filtering the repeat selection with another recordset via do while, to prevent duplicate from being entered into the database.
The multiple insert works without the filtering and insets the records into the database.
With the filtering it displays the filtered records (placing gaps where the removed -filtered out - records would be) but it will only insert sequential records into the database - if I try to insert the first and forth items - it only inserts the first - if I try to insert record 1,2 and 3 it inserts 1,2 and 3 - if I try to insert 1,2 and 5 it will only insert 1 and 2 and not 5. Hope I'm being clear on this... I'm looking to get all records inserted and remove the gaps where the other recordset has filtered out records.
Any help on this is appreciated. The code is below...
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_artcategories){
$tempartcat = 0000;
do {
if ($row_artcategories['categoryname'] == $row_artcatsselected['category']) {
$tempartcat = 9999 ;
}
} while ($row_artcatsselected = mysql_fetch_assoc($artcatsselected));
mysql_data_seek($artcatsselected, 0);
if ($tempartcat != 9999) {
?>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"><input type="hidden" name="retailerid_mihidden_<?php echo $RepeatSelectionCounter_1; ?>" id="retailerid_mihidden_<?php echo $RepeatSelectionCounter_1; ?>" value="1" />
<input type="checkbox" name="catselect_<?php echo $RepeatSelectionCounter_1; ?>" id="catselect_<?php echo $RepeatSelectionCounter_1; ?>">
<input name="categoryid_<?php echo $RepeatSelectionCounter_1; ?>" type="hidden" id="categoryid_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_artcategories['categoryid']; ?>">
<input name="categoryparent_<?php echo $RepeatSelectionCounter_1; ?>" type="hidden" id="categoryparent_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_artcategories['categoryid']; ?>">
<input name="retailerid_<?php echo $RepeatSelectionCounter_1; ?>" type="hidden" id="retailerid_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $_SESSION['CustomerID']; ?>">
<?php echo $row_artcategories['categoryname']; ?>
<input name="ItemID_<?php echo $RepeatSelectionCounter_1; ?>" type="hidden" id="ItemID_<?php echo $RepeatSelectionCounter_1; ?>" value="<?PHP echo $_GET['ItemID'];?>">
<input name="category_<?php echo $RepeatSelectionCounter_1; ?>" type="hidden" id="category_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_artcategories['categoryname']; ?>"></td>
</tr>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<tr>
<td> </td>
<td> </td>
</tr>
<?php } // RepeatSelectionCounter_1 End Alternate Content
}
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_artcategories && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_artcategories = mysql_fetch_assoc($artcategories);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop