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

Did you know?Explore Trending and Topic pages for more stories like this.
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

LSB (PHP 5.3) problem with static value!
hello,

i'm having a problem. static::$text variable gets lost at some point. can someone plea

Accessing element of object array
Hello

My object looks like this:


Array ( [0] => User Object ( [id] =>

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

session checking in page load
hai all I have a web site is www.Mryas.com in this my login page is Page1.aspx its co

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli

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

Problem with umlauts and UTF-8
Hello every1,

I'm creating my own little CMS at the moment and got some problems with the cha

str_replace help
I am thinking str_replace is my only option to filter outputs from my database to convert them to sa

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

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