close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Looping

Thread began 9/06/2012 10:17 am by tom92909 | Last modified 9/06/2012 11:36 am by Jason Byrnes | 735 views | 3 replies |

tom92909Beta Tester

Looping

I've got an issue that I'm having trouble working thru and I'm sure that I'm probably over thinking all of this just need someone to break me out of my brain lock.

I have 54 records in a MySQL table that I will need to run calculations on one at a time and then loop thru the records until done. ( SELECT COUNT(*) AS TotalRecords FROM table1 )

Step 1.
=========
Read 1st Record in table1.

Step 2.
=========
Run (6) different calculations on specific fields and get (6) separate results. (easily done with SQL query)

Step 3.
=========
Write the (6) results from 1st Record to table2 to specific fields using DataAssist.

Step 4.
=========
Run a (3) new calculations on the results stored in table2 for 1st Record to obtain (3) new results. (easily done with SQL query)

Step 5.
=========
Write the (3) results from Step 4 to table2 specific fields using DataAssist.

Step 6.
=========
Loop back to Step 1 and move to the next record not processed. This should run through all the records until complete.


My issue is the coding for Step 6. What is the best way to go about accomplishing this task? I can easily step through steps 1-5 for the 1st record.

Many thanks in advance!

Sign in to reply to this post

Jason ByrnesWebAssist

the code for steps 2 - 5 needs to be inside the repeat region for the step one recrodset

the code to loop through a recordset will look like this:

php:
<?php do { ?>

do something here
<?php } while ($row_recordsetForStep1 mysql_fetch_assoc($recordsetForStep1)); ?>




you just need to place the code for steps 2 - 5 inside the loop

php:
<?php do { ?>

perform step 2
perform step 3
perform step 4
perform step 5
<?php } while ($row_recordsetForStep1 mysql_fetch_assoc($recordsetForStep1)); ?>
Sign in to reply to this post

tom92909Beta Tester

Ok, I'm still working through my process and I found that I'm processing my last record first before my loop which is not what I want. I need to start with the first record process the steps then move to the next record and so on until all records have been processed in sequence.

The attached image shows that the last record was processed properly, but just in the wrong order.

Sign in to reply to this post

Jason ByrnesWebAssist

you must have some code in the wrong order than.

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