Blink Posted February 27, 2011 Report Share Posted February 27, 2011 (edited) Čau visiem, domāju uztaisīšu statistiku savai lapai.. Tātad - $pmweek = mysql_num_rows(mysql_query("SELECT id FROM messages WHERE date >= '".strtotime("week")."'")); viņš nevis nolasa week bet all nafig tā? ar today viss kārtībā, kā arī month viņš nenolasa :? ] atrisin'ts Edited February 27, 2011 by Blink Quote Link to comment Share on other sites More sharing options...
Kemito Posted February 27, 2011 Report Share Posted February 27, 2011 Ir diena, ir mēnesis, ir gads. Šaubos, ka iekļauts šajā funkcijā ir, ka nolasa nedēļu, JO: Kā viņš zina nedēļas intervālus? Quote Link to comment Share on other sites More sharing options...
briedis Posted February 28, 2011 Report Share Posted February 28, 2011 strtotime atgriež timestampu. A tu tur esi ierakstījis week. Ko tas nozīmē? Vienu nedēļu klāt šim laika momentam, vai vienu nedēļu uz atpakaļu?? strtotime("+1 week") vai strtotime("-1 week") Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 28, 2011 Report Share Posted February 28, 2011 (edited) Kāpēc, vienkārši, nedarīt... 60 * 60 * 24 * 7 $time = time() + 604800; // 60 * 60 * 24 * 7 = week. Edited February 28, 2011 by daGrevis Quote Link to comment Share on other sites More sharing options...
briedis Posted February 28, 2011 Report Share Posted February 28, 2011 Kāpēc, vienkārši, nedarīt... 60 * 60 * 24 * 7 $time = time() + 604800; // 60 * 60 * 24 * 7 = week. Rezultāts tas pats, ieekanomētas arī tiks pāris ms, bet lasāmība tomēr foršāka ar strtotime - paskaties un uzreiz skaidrs, nekas komentāros pat nav jāraksta :p Gaumes lieta, kamēr nevajag sarežģītākās darbības, kā nākošais mēnesis, vai iepriekšējā mēneša pēdējā svētdiena :) bet tas offtopiks.. Quote Link to comment Share on other sites More sharing options...
Blink Posted February 28, 2011 Author Report Share Posted February 28, 2011 darbojas last week last month last year Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.