Jump to content
php.lv forumi

Salīdzināt


sandis_m

Recommended Posts

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.

Link to comment
Share on other sites

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 by wintermute
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...