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

retrieving images from mysql database using php
So I've been trying to figure out how to store images in a mysql database, and as far as i can tell

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

update post issues
I am trying to create an update to a post function, while the update does occur, the page routing an

help with image text
Hi ...

see i need the text of the name and number to start in the center and always be in the

HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.

php call servlet
I have done a php backup application .
So there is a form that user pick some files to zip and d

tag inside php...
hi


Code: <?php
echo "<td width="$columnWidth%" align=&

why isn't this PHP code working ???
it's suppose to find a name on the database.

<?php

$s = $_POST["lname&

present value of sequence?
Hi

Please help me to find out the present value of sequence?

Thanks

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

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