Jump to content

Database Question


N-Bomb(Nerd)

Recommended Posts

I'm not really good at organizing my databases to be efficient, however I can't even begin to think of how to set this one up.

 

I'm trying to keep a log of all of the visitors that go to this certain page on my website. Basically I want to try to store their: Ip address, total visits to the page, all of the dates/times they visited. Basically I want everything to be sorted based on the users ip address..

 

By total visits to the page, I'm just wanting to know how many times they've been there total.. and when I'm saying "all of the dates/times they visited" I mean exactly what I say.. like a list sort of with every date/time they've visited that page..

 

I'm honestly lost on how I would set this database up. I've never really worked with databases much, I mean I have the general idea on how to create and use.. but nothing like this.

 

Perhaps some help for a confused, lost soul?  :'(

Link to comment
Share on other sites

why not use a web analytics tool instead? Google Analytics, Yahoo Web Analytics, Omniture Site Catalyst, etc...

 

Well, more than anything I would like to learn how to do something like this. I've thought of a few things where I could use something like this again.. so I don't think it would be a bad idea to learn. I've never really be into databases much, I don't know anything advanced about them and what not.

 

Is what I'm trying to learn one of the more complicated things?

 

Link to comment
Share on other sites

I can do the basic stuff, setup a table with some columns, use php to insert/select etc.. I haven't done any joins or anything like that though.. just the basics really.

 

I'm not quite sure how to design it.. I can have the basics such ip, visits etc.. in one table.. but let's say I'm going to have a lot of entries for one user on a specific thing.. such as an access date/time.

 

How am I'm going to manage access logs for multiple users though? The only thing that seems like it would work to me is having a ton of tables to do this..

 

1 table to hold ip address, total visits, etc.. then a new table for each ip address to log access logs..

 

That's mostly where I'm confused at, and obviously that isn't the logical choice.

Link to comment
Share on other sites

Start with a single table with IP, url, and timestamp.  Every time someone goes to any given page, simply insert that info into the table.  Then you can go back and build reports based off the data in that table. You can select distinct whatever, group by whatever, count whatever, etc... depending on what you want to know (top 10 urls by hits, whatever)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.