Jump to content

techiefreak05

Members
  • Posts

    494
  • Joined

  • Last visited

    Never

About techiefreak05

  • Birthday 03/24/1990

Contact Methods

  • Website URL
    http://tyny.us

Profile Information

  • Gender
    Male
  • Location
    ER, MN

techiefreak05's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Thanks, guys. I'm trying to make it pretty good Any suggestions?
  2. Thanks a lot, but could you elaborate? What do you mean password verification isn't showing up, and you can't check the file? Thanks.
  3. that's what I was afraid of. basically I run a query for all the unique IPs for any give project for the "lifetime stats", and when I get the weekly stats, I run a query for each DAY in the last week, that grabs the unique IPs for each DAY, meaning if a person visits a site each day for a week, his visit count is 7, and the weekly stats will count that as 7, while the lifetime stats sounts him as 1, since it gets the stats for a lifetime, instead of daily.
  4. I'm writing a web analytics script and it's working great, with graphs, detailed stast, etc... but I' having a problem coming up with the query to display the correct number of "visits" or "unique" hits... I can display total page views just fine... on the stats page I show the lifetime unique visits, and the lifetime total page views like so: LIFETIME UNIQUE VISITS: SELECT COUNT(DISTINCT(ip)) as unique_hits FROM tracking WHERE project_id = '2' LIFETIME TOTAL PAGE VIEWS: SELECT COUNT(ip) as total_hits FROM tracking WHERE project_id = '2' Those both work fine... but when I run the stats for the week, the "unique visits" for the week are GREATER than the lifetime unique visits... BECAUSE... I have a function that generates an array of dates in between the start and end parameters, and I loop through the array, and grab the total, and unique for that day.... but if someone visists the site each day, he will counted 7 time, once for each day, since the loop looks for the unique for each day... WEEKLY STATS: <?php //$range is the array of dates. foreach($range as $day=>$xdate){ $sql_Counter = "SELECT COUNT(DISTINCT(ip)) as unique_hits, COUNT(ip) as total_hits, '".$xdate."' as raw_date, date_format(date,'%Y-%m-%d') as date_only , date_format('".$xdate."','%m-%d') as xdate_only FROM tracking WHERE project_id = '".$proj."' AND date_format(date,'%Y-%m-%d') = date_format('".$xdate."','%Y-%m-%d')"; $q_Counter = mysql_query($sql_Counter) or die(mysql_error()); while($r2=mysql_fetch_assoc($q_Counter)){ // add each day's value to the total values for the week... } } ?> How can I update the lifetime unique visits query to count the number of EACH unique ip's and add them together? Thanks a lot.
  5. Well LAST_INSERT_ID() doesn't exist in PHP. Um... echo $name_id and see what happens
  6. I was really bored, wrote this script, and have recently added lots of functionality to it. - password protect links - custom short links - detailed stats page - "link preview" shows you the real URL and the title of the page before proceeding. I'm also expanding the statistics feature quite a bit to the point where it's becoming it's own service. I use the more detailed stats feature on the actual domain itself. If you view the source, you'll see a JS files is included "http://tyny.us/ispy/ispy.js" If anyone is interested, I can setup a project for you, give you a piece of JS code, and the stats page URL so you can give it whirl. Here's a sample stats page: http://tyny.us/project/view/ETjer5j45J Note: You don't need to signup for an account, but if you do, I'll attach the project to your account and it'll appear on your dashboard when you login. Thanks
  7. After some tweaking, I got it. You were correct, it worked as needed. I ended up with this, in case you're curious: SELECT DISTINCT date_format(date,'%Y-%m-%d') as xdate FROM `tracking` WHERE owner_id = '18' AND project_id = '1' AND date_format(date,'%Y-%m-%d') BETWEEN '".$start."' AND '".$end."'
  8. Actually, I think that would work... but it depends. Does the range go THROUGH the "end" date? or to midnight of?
  9. I am building an analytics service, and whenever a page is loaded, it inserts a row into the database with tons of user information. Simple enough. Each row has a DATETIME field (ex, "2010-09-30 11:53:14") and after a while I've been able to count the number of unique visits, and total visits for a particular day. Here's the query that will run for EACH day: SELECT COUNT(DISTINCT(ip)) as unique_hits, COUNT(ip) as total_hits, date as raw_date FROM tracking WHERE date_format(date,'%Y-%m-%d') = '2010-09-30' Basically I want to be able to pick 2 dates from a form, and then loop through each day between them, and run the query above for each day. I hope I made sense... haha. Thanks a ton.
×
×
  • 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.