N-Bomb(Nerd) Posted October 11, 2009 Share Posted October 11, 2009 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? :'( Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/ Share on other sites More sharing options...
N-Bomb(Nerd) Posted October 11, 2009 Author Share Posted October 11, 2009 :'( Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-934867 Share on other sites More sharing options...
.josh Posted October 11, 2009 Share Posted October 11, 2009 why not use a web analytics tool instead? Google Analytics, Yahoo Web Analytics, Omniture Site Catalyst, etc... Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-934918 Share on other sites More sharing options...
N-Bomb(Nerd) Posted October 11, 2009 Author Share Posted October 11, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-934973 Share on other sites More sharing options...
.josh Posted October 11, 2009 Share Posted October 11, 2009 well, not complicated per se...but it could very easily snowball to the point where you have to stop and ask yourself why you're reinventing the wheel. Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-934976 Share on other sites More sharing options...
N-Bomb(Nerd) Posted October 11, 2009 Author Share Posted October 11, 2009 well, not complicated per se...but it could very easily snowball to the point where you have to stop and ask yourself why you're reinventing the wheel. Well, I'm curious to learn actually.. do you happen to know what I should start researching/looking into? Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-934994 Share on other sites More sharing options...
N-Bomb(Nerd) Posted October 11, 2009 Author Share Posted October 11, 2009 Last bump before I go to sleeps.. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-935018 Share on other sites More sharing options...
.josh Posted October 11, 2009 Share Posted October 11, 2009 I admire your willingness to learn but it's kind of hard for me to know where to point you when I don't really know what your current skill level is. Do you already know how to do basic database interaction (setup a table with some columns, use php to insert/select stuff, etc..)? Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-935020 Share on other sites More sharing options...
N-Bomb(Nerd) Posted October 11, 2009 Author Share Posted October 11, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-935025 Share on other sites More sharing options...
.josh Posted October 11, 2009 Share Posted October 11, 2009 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) Quote Link to comment https://forums.phpfreaks.com/topic/177305-database-question/#findComment-935027 Share on other sites More sharing options...
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.