close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Repeat selection filtered by another recordset

Thread began 1/12/2010 8:44 am by Les Crowley | Last modified 1/12/2010 5:58 pm by Jimmy Wu | 1041 views | 3 replies |

Les CrowleyBeta Tester

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">&nbsp;</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>&nbsp;</td>
<td>&nbsp;</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
Sign in to reply to this post

Jimmy Wu

It looks like a similar issue has come up with using checkboxes and if a checkbox is skipped, the rest of the items do not get inserted. It looks like the workaround to this issue was to put in a hidden form field into repeat region and use that hidden form field for loopedFields. This will loop through all the items and then when inserting, it will only insert when the checkbox is checked.

Would something like that work for you?

Sign in to reply to this post

Les CrowleyBeta Tester

Thanks Jimmy. That worked like a charm... hopefully this will be fixed in future dot release of DataAssist.

Sign in to reply to this post

Jimmy Wu

Glad it worked out for you. If you run into any additional issues, feel free to open a new thread.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...