close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

update multiple records, debugging

Thread began 7/27/2010 3:42 am by CraigR | Last modified 9/02/2010 9:16 am by Jason Byrnes | 3528 views | 16 replies |

CraigRBeta Tester

update multiple records, debugging

slightly frustrated, i have been trying to update multiple records using the solution recipe pdf.
(i have used the insert new records server behavior successfully in the past)

After a couple of attempts, the wizard runs ok, but nothing is being updated.

(i also noticed the form doesn't redirect on submission).

i have tried in vain to debug, but can't find the fault.

Sign in to reply to this post

mustang_sally_85344510

I have the same problem every time I use any of the multiple inserts, updates, delete....

I found that DA doesn't line up the code correctly.

If you look at the code on your other (past ones that worked).
You will see how the code lined up properly.

php do should be first...
Then the repeat section multiple counter loop...then the form fields...(without the submit button) alternative content loops..
Then...<?php } while ($row_rswhateverhere = mysql_fetch_assoc($rswhateverhere)); ?>
Then your button (without ANYTHING added to it...just the button name.

I run the wizard then cut and paste the code where it belongs.

Sure wish this issue would get fixed...:(

I made a post about this a while ago with multiple deletes....

Hope this helps you out. :)

Sign in to reply to this post

CraigRBeta Tester

getting there ?

Thanks for the reply.

I moved the submit button as it was in the loop for some reason.

the form now at least posts successfully, but the recordset isn't (yet) updated

Sign in to reply to this post

mustang_sally_85344510

I see in your code, the repeat is above your <? php do {?>
You need to move that.... to below <? php do {?>

Also you need to move your:
<?php } while ($row_rswhateverrecordset= mysql_fetch_assoc($rswhateverrecordset)); ?>

Also, make sure your submit button doesn't have any extra values added to it.
It should be just the name of the buttom.
DA has been adding code to the submit button....when the wizard runs...when it wraps the whole table...
That is the reason for repositioning the code. !


Here is a working example of where the code should be located....
I found it applys to all multiple, insert, update delete.


<?php do { ?>
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_rsmessages){
?>
<tr>
<td colspan="2"><div align="center"><?php echo $row_rsmessages['fromUserName']; ?></div>
</td>
<td><div align="center"><a href="message.php?messageID=<?php echo $row_rsmessages['messageID']; ?>"><?php echo $row_rsmessages['subject']; ?></a></div></td>
<td><div align="center">
<input type="hidden" name="WADA_RepeatID_messageID_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_messageID_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rsmessages["messageID"]; ?>" />
<input type="checkbox" name="checkboxDelMess_<?php echo $RepeatSelectionCounter_1; ?>" id="checkboxDelMess_<?php echo $RepeatSelectionCounter_1; ?>" value='<?php echo $row_rsmessages["messageID"]; ?>'/>
</div></td>
</tr>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<td width="18%">No Messages</td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_rsmessages && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_rsmessages = mysql_fetch_assoc($rsmessages);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
<?php } while ($row_rsmessages = mysql_fetch_assoc($rsmessages)); ?>
<tr>
<td colspan="3">&nbsp;</td>
<td><div align="center">
<input type="submit" name="DelMessBtn" id="DelMessBtn" value="Delete" />
</div></td>
</tr>
</table>
</form>

Sign in to reply to this post

CraigRBeta Tester

thanks again sallly.

it took me a little while, as i had two do..while loops on my page (i am updating from a dynamic list), but after some thought, i got it working.

the server behavior is great, (on a separate project, i managed to get the insert working directly from the wizard one time), but it seems to go wrong quite easily.

A few debugging pointers would help WA ! ;)

Sign in to reply to this post

CraigRBeta Tester

delete ?

having resolved the problem with multiple update, i managed to (successfully) create a multiple insert.

the multiple delete wizard also went smoothly, though when it works at all, only one row is deleted.

i trawled through the order of events, and they SEEM ok.

I have attached the partially working page

Once this works, i am going to keep the code and copy and paste it if i need it again!!

Sign in to reply to this post

Eric Mittman

I have done some testing of the multiple update server behavior and the pdf that shows how to apply it. In my testing if I follow along with the pdf the code is written correctly and the records are updated just as they should. After going through the steps I do not have to do anything to the code to get it working.

I would like some info from one of both of you about the circumstances that you are experiencing these errors in. Please post back and include as much detail as you can about your setup and OS, DW, and DataAssist versions that you are using. If there is a problem with the multiple update or any of the other server behaviors I would like to know about it as soon as possible so that we can get bugs properly logged if needed. I'm including a copy of the page that I did my test with for reference.

Attached Files
multi_update.php.zip
Sign in to reply to this post

CraigRBeta Tester

thanks eric.

i will start afresh tomorrow, providing a detail breakdown of my database table structure and page as it is built.

regards

Sign in to reply to this post

mustang_sally_85344510

my circumstances.

I am working in winxp, have supersuite, CS3. DA 2 2.7, DFP2, I have bought the programs, and don't partake in your subscription program.
All sites are built with PHP..

My experiences with any of the multiples, insert, update and especially delete.

99% of the time....DA wraps itself around my complete table.

I have figured the work around it, (but not happy that I have to).

A couple of months ago, I posted and got some help with it.

But bottom line, I usually have to readjust where the code should go.

As you can see where I posted an example for Craig, that is the work I did...with rearranging the code supplied by the wizard. It works for me.

*Note*
If I create a multiple (anything) on a blank page...
It will usually create the code in the proper place.
But when inserted into a page with other coding going on I usually have to rearrange the code.

You can see other multiple delete problems I have had with a previous posts I've submitted here in this forum...."irratic behavior multiple deletes".
showthread.php?t=12458

Just worked with this the other day,...multiple deletes.
And the same "wrap around everything" occured.

Instead of coming in here again, complaining, I just rearranged the code.

I am not currently working with this...
But wish this bug would get fixed.

I just tried to help out Craig.... :)

Where I had the most problems...is when I have multiple insert, update and delete on the same page....
I would suggest that you craft a page and try putting 3 or more of any of the above multiple behaviors on a page...to get the drift...;)

Sign in to reply to this post

mustang_sally_85344510

Originally Said By: CraigR
  having resolved the problem with multiple update, i managed to (successfully) create a multiple insert.

the multiple delete wizard also went smoothly, though when it works at all, only one row is deleted.

i trawled through the order of events, and they SEEM ok.

I have attached the partially working page

Once this works, i am going to keep the code and copy and paste it if i need it again!!  



I seen the errors, where the code isn't placed properly...

Humor me and give this a try...

I moved the code for ya...:)

Attached Files
revised4U.zip
Sign in to reply to this post
loading

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...