PHP problems (urgent)

Source: Internet
Author: User
PHP problems (urgent) please help: The following cache code: how to call the diamond rankings every 15 minutes, charm charts, and job rankings: // call cache $ cacheM = newSeed_Model_Cache2File (); $ money_list = $ cacheM-& gt; get (& quot; money_list PHP (urgent)
Please help: The following cache code: how to call the diamond rankings, charm charts, and job rankings every 15 minutes:
// Call cache
$ CacheM = new Seed_Model_Cache2File ();
$ Money_list = $ cacheM-> get ("money_list ");
$ Extcredits2_list = $ cacheM-> get ("extcredits2_list ");
$ Extcredits1_list = $ cacheM-> get ("extcredits1_list ");

If (! Isset ($ money_list )){
// Diamond list
$ UserM = new User_Model_User ('user ');
$ Money_list = $ userM-> fetch_rows (array (0, 7), $ where_str, array ('money desc '));
// Echo 111; // test whether cache is in use;
$ CacheM-> save ("money_list", $ money_list );
}
If (! Isset ($ extcredits2_list )){
// Charm list
$ BbsM = new User_Model_Bbs ('bbs ');
$ Extcredits2_list = $ bbsM-> fetch_rows (array (0, 7), $ where_str, "extcredits2 DESC ");
$ CacheM-> save ("extcredits2_list", $ extcredits2_list );
}
If (! Isset ($ extcredits1_list )){
// Job score list
$ Extcredits1_list = $ bbsM-> fetch_rows (array (0, 7), $ where_str, "extcredits1 DESC ");
$ CacheM-> save ("extcredits1_list", $ extcredits1_list );
}

$ This-> view-> money_list = $ money_list;
$ This-> view-> extcredits2_list = $ extcredits2_list;
$ This-> view-> extcredits1_list = $ extcredits1_list;

------ Solution --------------------
Use the system's task scheduler. Otherwise, write an endless loop; sleep (15*60) shell call.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.