Get the first id that is larger than the id of the tip with the latest
date
If this doesn't exist, get the tip with the smallest id
Update the selected tip with today's date
Store the date and tip in the application scope
If the date in the application scope is less than today's date or there
is no tip, start the procedure again
Pascal
> -----Original Message-----
> From: daniel kessler [mailto:[EMAIL PROTECTED]
> Sent: 11 August 2004 20:03
> To: CF-Talk
> Subject: Re: tip of the day
>
> ok, I have another TOTD question. I was told that each tip can only
be
> displayed once and that they would prefer that I go down the list from
> record 1 to n. When all records are displayed once, then I can go
through
> the list again.
>
> I have a thought on a way to do this, but not sure if it's sensible or
the
> best way:
>
> 1 - Have a "tip_used" column.
> 2 - Query for a list of unused tips, sorted by their ID field will
will be
> an ascending unique number.
> 3 - If the number of unused tips is 0, then go through all the records
and
> set them all to unused ( ? )
> 3 - Grab the first tip, get it's ID.
> 4 - Query for that ID and make it a cached query.
>
> and maybe i can put all this in a <cflock> to make it all happen at
once?
>
> All thoughts are appreciated.
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

