SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict ewiz's Avatar
    Join Date
    Dec 2003
    Location
    Egypt
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to differentiate visitors using two fields

    I have a database table 'daily' with 'id', 'date' (YYYYmmddhhmmss), 'ip' (varchar for visitor's ip).
    I store every hit that is done by a visitor to calculate the total hits at the end of the day. But I need to calculate the number of visitors using this fact:
    If the same ip occurs in many records each within 10 minutes of the other, this is one visitor.
    This is important because some ips have a daily average of 4000 records (dialups).
    Is there a way to accomplish this when processing the information at the end of the day?
    Thanks.
    add your hosting company and plans for free
    Ahsan Host
    my business site
    Internet Plus

  2. #2
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I highly suggest doing this in your procedural language. I can't come up with any way to do this in pure SQL - too hard to get the grouping done, if it's even possible.

  3. #3
    SitePoint Addict ewiz's Avatar
    Join Date
    Dec 2003
    Location
    Egypt
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK but analysing millions of records using PHP will be painful for the server
    add your hosting company and plans for free
    Ahsan Host
    my business site
    Internet Plus

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by ewiz
    OK but analysing millions of records using PHP will be painful for the server
    doing it with sql will be worse
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •