Making records in a loop in a random order each ti

Results 1 to 2 of 2

Thread: Making records in a loop in a random order each ti

  1. #1
    Join Date
    Dec 1969

    Default Making records in a loop in a random order each ti

    How would I loop the contents of a repeat region, so that a different entry<BR>from the database appears at the top of this list each time the page is<BR>loaded. The entries must cycle through like this:<BR><BR>1st page load:<BR><BR>1 (record 1)<BR>2<BR>3<BR>4<BR><BR>2nd page load<BR><BR>2<BR>3<BR>4<BR>1<BR><BR>3rd page load<BR><BR>3<BR>4<BR>1<BR>2<BR><BR>etc, etc<BR><BR>The client has specified that it must loop in this fashion, so that each<BR>person who has a record in the database gets their fair share of time at the<BR>top of the list. The state of the list must be maintained so that any one<BR>else who views the list sees someone different at the top of the list, that<BR>is different than the previous viewer. ( i hope i make sense here)<BR><BR>Does anyone know how to do this?????<BR><BR>Thanks heaps for any help<BR><BR>bill.<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Making records in a loop in a random order eac

    interesting. how about designating a startpoint to begin looping from for display. when at EOF, go back to the start then loop till you&#039;re almost at the startpoint, then stop and increment the startpoint in the database.<BR><BR>it would necessitate storing the startpoint somewhere, say in a small table in the DB (more persistent than an app variable.<BR><BR>using this you&#039;d get this sort of effect<BR><BR>startpoint : 1<BR>1234<BR>startpoint incremeted to 2<BR>2341<BR>inc to 3<BR>3412<BR>inc to 4<BR>4123<BR>reset to 1<BR>1234<BR>ad nauseum...<BR><BR>see what I mean? the mechanics of it are not too complex, but should be fun to do... important bits : retrieving and initialising the startpoint (not so bad, it&#039;s related to your recordcount). then the looping code would have to take into account starting and ending in the middle *except* when you&#039;re back at record 1<BR><BR>j<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts