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

Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.

I have a table "quote" wit

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

gettext translates ALWAYS?
I'm using gettext with the new version of XAMPP (5.3.0) on Windows Seven RTM (build 7600)
gettext

Select all entries from database that include a phrase
I have a database of clubs - one of the categories is meeting time and place
I would like to have

How can i use [] tags instead of <> tags for profiles??
On my site im making ive made it so u can register, login and u have a profile which u can update..<

Help? Need help on project with templates involving mysql and php.
I'm having a hard time explaining what I want but basically here is what I have in place:

-Da

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

fie

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

Wrong Info sent Using $get in form
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls

Windows Authentication
I have a website which is windows authenticated.
now i want something more on this application.<

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