Here's a display of the tips:
http://hhp.umd.edu/HHPv1/dbf/tipFunctions/totd.cfm
A list of the tip states:
http://hhp.umd.edu/HHPv1/dbf/tipFunctions/db_display.cfm
and the code (if you view the source):
http://hhp.umd.edu/HHPv1/dbf/tipFunctions/totd.txt
I've looked around and don't see anything that would produce the extra chars. It happens to whatever tips is grabbed after the reset or occurs during the reset.
Any thoughts?
And thanks alot for the code. It's great. Oh and I don't have the createTimeSpan in yet because I was testing the rest of it first.
daniel
> keep what you got with the 24 hour cache... add your tipUsed column to
> the table
>
> when u have a tip to display.. throw an update query in there to flag
> the tipUsed column as used
>
> thats pretty much it :)
>
> so now when the cache expires, the next tip will be grabbed and
> flagged
> <cfquery name="gettip" datasource="MYDSN" maxrows="1"
> cachedwithin"#CreateTimeSpan(1,0,0,0)#">
> select * from tbl_tips where tipUsed = 0
> </cfquery>
>
> this will grab the first tip that it comes to where TipUsed is 0
>
> now set the tip being used as Used
>
> <!--- If there was no record returned then the table is either empty
> or all tips are set to USED and will need to be reset --->
> <cfif GetTip.RecordCount is 0>
> <!--- Reset all tips to NOT USED --->
> <cfquery name="ResetTips" datasource="MYDSN">
> UPDATE tbl_Tips
> SET TipUsed = 0
> </cfquery>
>
> <!--- after its reset, THEN grab your tip and cache it --->
> <cfquery name="gettip" datasource="MYDSN" maxrows="1"
> cachedwithin"#CreateTimeSpan(1,0,0,0)#">
> select * from tbl_tips where tipUsed = 0
> </cfquery>
>
> </cfif>
>
> <!--- now as long as your table is not empty, you have a tip and can
> set it to USED (TipUsed = 0) --->
> <cfif GetTip.RecordCount NEQ 0>
> <cfquery name="UpdateTip" datasource="MYDSN">
> UPDATE tbl_Tips
> SET TipUsed = 1
> WHERE TipID = #val(GetTip.TipID)#
> </cfquery>
>
> <cfoutput>#GetTip.Tip#</cfoutput>
> </cfif>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

