Jump to content
php.lv forumi
Sign in to follow this  
kristers_Z

Unikālās IP datubāzē

Recommended Posts

Vēlos ievākt statistiku par visām IP adresēm, kas apskata saitu. Saits sastāv no daudzām sadaļām un nepieciešams zināt, kuras sadaļas un cik reižu konkrētā IP adrese apskata. Kā varētu vislabāk uzbūvēt datubāzi šādam mērķim, izvairoties no dublētiem datiem?
 

Un vēl - kādā datu tipā glabāt IP adreses? 

Edited by kristers_Z

Share this post


Link to post
Share on other sites

Varchar 40. Bet tev nevajag programmēt. Ej mopšojies kur citur.

Edited by F3llony

Share this post


Link to post
Share on other sites

Google Analytics.

Share this post


Link to post
Share on other sites

`ip_history` (`ip`,`path`,`times_visited`)

 

 

Tur nesanāk dublēt ip un path pie dažādām ip? 

 

ip                path     times_visited

127.0.0.1  /about  5

127.0.0.1  /info      6

127.0.0.1  /home  7

Edited by metal-0-1

Share this post


Link to post
Share on other sites

IPV6 ignorējam.

Share this post


Link to post
Share on other sites

nu path protams tiks dublēts pie katras jaunās IP. Ja neder tāds variants, tad visticamāk, ka Tev nekas cits neder kā tavējais, bet būtu stulbi katram path taisīt savu kollonu. Tik pat labi serialized var turēt @db, bet tad filtrācija sux 

Share this post


Link to post
Share on other sites

IP tabula, path tabula un starptabula ar ID uz abām tabulām.

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...