Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9269767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:12:21+00:00 2026-06-18T15:12:21+00:00

I have a mysql database that I store visitors in. id ip date —

  • 0

I have a mysql database that I store visitors in.

id        ip             date
--     -----------    ------------------   
1      192.168.0.1    2013-02-08 12:12:04
2      192.168.0.1    2013-02-08 14:30:00
3      192.168.0.1    2013-02-09 16:43:46
4      192.168.0.1    2013-02-10 08:35:02

This a simplified version of that i am using but the concept is the same. I want to be able to get the number of visitors and display them in a chart by time interval. I use the following array design to populate the chart, where 0,1,2,3 is the x axis and 24, 74, 26, 51 is the y axis.

 [[0, 24], [1, 74], [2, 26], [3, 52]]

I have tried to use the queries from stack question like this for instance but i cant get it to work with the Group by and that. Any help will be appreciated.

 $query = "SELECT COUNT(id) FROM  `unique_visitors_user` WHERE DATE(date) BETWEEN '2013-02-08' AND '2013-02-10' ";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:12:22+00:00Added an answer on June 18, 2026 at 3:12 pm

    This one should count all visits by day

    SELECT COUNT(id)
    FROM `unique_visitors_user`
    WHERE date >= "2013-01-01" 
    AND date < DATE_ADD("2013-01-01", INTERVAL 1 DAY)
    GROUP BY DAY(date)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mysql database that looks like this: |id | city | created
I have a mysql database table that will store locations for buildings and events
We have a relational database (MySql) with a table that stores Whatever. This table
I have a MySql database that stores a timestamp for each record I insert.
I have a mysql database that has text stored in it with non encoded
I have a MySQL database that I am keeping temperature readings from several different
I have a mysql database that is tracking hockey stats. What I'd like to
The code below works great. I have a MySQL database that contains book titles
I have a MySQL database called csftdb and in that database there exists 1
I have a MySQL database, and a particular table in that database will need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.