kristers_Z Posted July 30, 2013 Report Posted July 30, 2013 (edited) 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 August 27, 2013 by kristers_Z Quote
anonīms Posted July 30, 2013 Report Posted July 30, 2013 (edited) `ip_history` (`ip`,`path`,`times_visited`) kas vainas šādai lietai? nočeko vai ip un path jau ir pievientos un tad vnk +1 times_visited. http://php.net/manual/en/function.ip2long.php Edited July 30, 2013 by anonīms Quote
F3llony Posted July 30, 2013 Report Posted July 30, 2013 (edited) Varchar 40. Bet tev nevajag programmēt. Ej mopšojies kur citur. Edited July 30, 2013 by F3llony Quote
Kasspars Posted July 30, 2013 Report Posted July 30, 2013 Google analītiķis nerāda IP adreses (sasodītais privacy) Quote
daGrevis Posted July 30, 2013 Report Posted July 30, 2013 http://php.net/manual/en/function.ip2long.php http://php.net/manual/en/function.long2ip.php Quote
F3llony Posted July 30, 2013 Report Posted July 30, 2013 Jā, jā, protams. A IPV6 ta ko, turpinam mierīgi ignorēt? Quote
Aleksejs Posted July 30, 2013 Report Posted July 30, 2013 Ko tur ar VARCHAR ķēpāties - liec uzreiz LONGTEXT :D Quote
metal-0-1 Posted July 30, 2013 Report Posted July 30, 2013 (edited) `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 July 30, 2013 by metal-0-1 Quote
anonīms Posted July 30, 2013 Report Posted July 30, 2013 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 Quote
daGrevis Posted July 30, 2013 Report Posted July 30, 2013 IP tabula, path tabula un starptabula ar ID uz abām tabulām. Quote
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.