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

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

Memory Allocation
Hi folks,
see this ex:

int v=5;
v=v+10;

then what will do the compiler before th

Procedure with variable number of columns
Hi, I have a procedure that looks like this:

PROCEDURE PROC(p_cursor OUT sys_refcurso

Php Mysql Page Loading Notice
Hi all,

I was wondering if there is a way (Sure there is) of showing a message or an image wh

need help about
i store the value of my select statement result to an array and stored it to a variable named $fname

login box shows up again after logging in 2nd login works
Hello,

I am having trouble on my site Lockerz.rack111.com where when you login the login box

cURL Sending File as Post
This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a d

HTML Email rec'd as Source Code
The code does create and send the email successfully. However, the message shows as html code and n

noob cURL help
I have a pretty basic form that I need to cURL post to a file in my includes folder (includes/login.

Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related codi

start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get

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