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

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg

From Header Showing 'Unkown' In Hotmail? Why?
Code: $to = $row_GetID['email_addr'].',sales@mywebaddress.co.uk';
$subject = 'Thank you for you

PHP Code / Script To check weather the given email exists in a domain
Hi,

I want to implement the following in my web page

in sign up we will ask to enter u

MySQL noob question
hi guys

I have a simple mysql table set up, along the lines of

Col 1 - Col 2 - Date_l

Read from forum
Haven't written anything forever and I would like to get back.
What I'm trying to do is getting t

sql problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields.

fie

Email Script does not reach destination
Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "

UDP Multicast question
Hey,

Im not really in the know when it comes to network related programming and activitie

ALV grid with 2 headers
Hi Gurus,

I need to display ALV GRID as below.

Header1

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