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

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields

Multi dimensional arrays
If I put in this code:

1
2
3
4
5
6
7
8
9
10
11
12
13<

Word filter problem
Hello,

im trying to make a filter for words inputted in to my website but i want to store the

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacing

At pres

Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the

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