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 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 do { ?>
perform step 2
perform step 3
perform step 4
perform step 5
<?php } while ($row_recordsetForStep1 = mysql_fetch_assoc($recordsetForStep1)); ?>