Any mySQL experts around?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Danielle
    Confirmed User
    • Jun 2002
    • 1227

    #1

    Any mySQL experts around?

    I have a table that has these fields

    pagename
    visitdate
    surferIP

    I can list raw page visits by doing this.

    SELECT pagename, COUNT(*) FROM pagevisits WHERE visitdate >= '$search_date_start' AND visitdate <= '$search_date_end' GROUP BY pagename

    What I want to do is list pages by UNIQUE visit.

    How would I do that?

    Hugs,
    Danielle
  • hand-held
    Confirmed User
    • Sep 2006
    • 136

    #2
    Uh...

    select pagename, count(distinct surferIP) from pagevists group by pagename

    ?
    Pimp pimp... hooray! Pimp pimp... hooray!

    Comment

    • Danielle
      Confirmed User
      • Jun 2002
      • 1227

      #3
      Originally posted by hand-held
      Uh...

      select pagename, count(distinct surferIP) from pagevists group by pagename

      ?
      Actually tried that. It returned zero for each pagename.

      Hugs,
      Danielle

      Comment

      • Danielle
        Confirmed User
        • Jun 2002
        • 1227

        #4
        Originally posted by hand-held
        Uh...

        select pagename, count(distinct surferIP) from pagevists group by pagename

        ?
        Hold on. You are right! Thanks! I was trying to display it wrong.

        Hugs,
        Danielle

        Comment

        • Catalyst
          Confirmed User
          • Jun 2003
          • 3243

          #5
          so.. you got it working correct?

          Comment

          Working...