Hits this week counter


Posted on 16th Feb 2014 07:03 pm by admin

I have a counter on my site that tracks hits, IP's, etc. into a mySQL database. It also includes the date in the entry. The code I'm using, that's not working, to try and retrieve the amount of hits in the last 7 days is:
$hitsWeek = mysql_result(mysql_query("SELECT SUM(`hits`) FROM `stats` WHERE `date` > '$time-604800' GROUP BY `date`"),0);
However, I'm getting this error: Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 10 in /var/www/main.php on line 50

Did you know?Explore Trending and Topic pages for more stories like this.
Can anybody help me out with this?
No comments posted yet

Your Answer:

Login to answer
190 Like 32 Dislike
Previous forums Next forums
Other forums

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

sql error
I have been looking at this code for 20mins and can't work out what I am doing wrong. There is somet

Coding question?
Hey guys, I have a quick question. If I want to make a way for people to pay for health in my game,

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

turning an array into a string then poping it into a db
Hi im just wondering how you get a requested array into a single string then pop it into the db so f

Add User script "Could not execute query"
This should be an easy script but I can't get it to run. Can someone please help me?

<

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

Could Someone Please Debug This?
I was wondering if someone could debug this script for me. I realize it's not the tidest script (and

FROM_UNIXTIME($phpdate);
Hello,

I tried to use this :

$date = FROM_UNIXTIME($phpdate);

ANd I was t

Transport data between itab and textfield on ALV event
Hallo,

I have a ALV Grid ( cl_gui_alv_grid ) and I also have hotspot click event with a h

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash