It's not really that bad, maybe I just made it sound complicated and
annoying.

(pseudo-php)

If (dataexistsindb) {
    $cachedata = SELECT cachedata from DB
    $dataarr = unserialize(cachedata)
} else {
    $dataarr = SELECT freshdata
    $cachedata = serialize($dataarr)
    INSERT or UPDATE $cachedata into DB
    // INSERT if you want to keep a history of cachedata
    // UPDATE or I guess REPLACE if you want to keep just one copy of
the cache
}

If you make changes during the day and/or to just do another
UPDATE/REPLACE..  Either looking for the single record or the one with
today's date on it.

-TG


> Seems like a huge headache, maybe store the array in a 
> session is the best
> bet, but then yes what if one of the admins goes into manage 
> tool i built
> to manage the data on the pulldown menus ? So would you 
> suggest store the
> array in a cache table as serialized, then if we update 
> replace the data ,
> using REPLACE ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to