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

Help with Hyperlink
Hi,

What I am trying to do may be simple, I just can't get it to work. Ok...

I am usin

single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be

extract data
Code: <div class="post hentry uncustomized-post-template">

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way

How can I Compare two xml documents?
Hi all,

I am doing a POC for my project and I am using XE database 10g version.

A little help in c#
i am doing a simple paint program using c# i want to draw with the mouse so i wrote the code of the

What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

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