sandis_m Posted March 11, 2011 Report Share Posted March 11, 2011 Table `sites` id | site | time | user 1 | site.uk/home.php |1299858828 | 1 2 | site.uk/user.php |1299858838 | 1 3 | site.uk/user.php |1299858839 | 1 4 | site.uk/user.php |1299858840 | 1 Kā salīdzināt to `time` vai no konkrēta lietotāja nav par daudz refresh uz kādu konkrētu lapu. Quote Link to comment Share on other sites More sharing options...
Aiviss Posted March 11, 2011 Report Share Posted March 11, 2011 atņemot: x-y = z bet to jau tu noteikt biji iedomājies. Quote Link to comment Share on other sites More sharing options...
sandis_m Posted March 11, 2011 Author Report Share Posted March 11, 2011 (edited) SQL pieprasījumā tas nederēs Edited March 11, 2011 by who_i_am Quote Link to comment Share on other sites More sharing options...
wintermute Posted March 11, 2011 Report Share Posted March 11, 2011 (edited) Nomet pirmos 4 vai 5us ciparus , un tad izrēķini http://en.wikipedia.org/wiki/Absolute_deviation Jo vērtība tuvāka 1, jo lielāka iespēja ka jūzeris kaut ko čakarē. Tas gan neparādīs tev cik reizes katra lapa apmeklēta. Un tieši kāpēc SQL neder ? Edited March 11, 2011 by wintermute Quote Link to comment Share on other sites More sharing options...
sandis_m Posted March 11, 2011 Author Report Share Posted March 11, 2011 Un tieši kāpēc SQL neder ? Tas par to x-y=z variantu. Quote Link to comment Share on other sites More sharing options...
codez Posted March 11, 2011 Report Share Posted March 11, 2011 SELECT count(*) FROM sites WHERE time<unix_timestamp() and time>unix_timestamp()-1000 and user=1 Nosaka apmeklēto lapu skaitu pēdējās 1000 sekundēs. Bet, ja tiešām šādi grib ierobežot lietotāju, tad jādomā, kā šo rezultātu skaitīt atsevišķi user tabulā, lai katreiz nav smagi pieprasījumi jāizpilda. 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.