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

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.

How would I exac

Website Direction...
I recently used this code to try and make it so the page loads as http://www.domain.com/ when you ty

upload control not working with update panel
Hi,

I am working with Asp.Net FileUpload control with ajax update panel,

if i use the

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

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

Why does my php page download images over and over
Can anybody please explain to me why my php page keeps downloading the images and other items every

Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least use

apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

please help
HTML Code:

Code: <span id="ctl00"><span>

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