eccolo pronto:
codice:
Dim iquote_of_the_day : iquote_of_the_day = getConfig("quote_of_the_day")
Dim inumber_quote_of_the_day : inumber_quote_of_the_day = getConfig("number_quote_of_the_day")
open_recordset rs_getQuote,"select * from quote"
open_recordset rs,"select * from idate"
if month(now()) < 10 then
imonth = "0"& month(now())
else
imonth = month(now())
end if
idate1 = day(now()) & "/" & imonth & "/" & year(now())
idate2 = formatdatetime(rs("iday"),2)
rs.close
Randomize Timer
intRnd = (Int(RND * rs_getQuote.RecordCount))
if iquote_of_the_day = "1" then
if idate1 <> idate2 then
sql_update = "update config set config_value="&intRnd&" where config_variable = 'number_quote_of_the_day' "
conn.Execute(sql_update)
sql_update = "update idate set iday='"&now()&"'"
conn.Execute(sql_update)
rs_getQuote.Move intRnd
else
rs_getQuote.Move inumber_quote_of_the_day
end if
else
if session("id") = intRnd then
do while session("id") = intRnd
intRnd = (Int(RND * rs_getQuote.RecordCount))
loop
end if
rs_getQuote.Move intRnd
session("id") = intRnd
end if
l'ho ripulito delle parti non significative....