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?
Can I use a loop
Hi buddies!
Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query question (original post http://www.phpfreaks.com/forums/index.php/topic,273323.0.html) has become a PHP
Merger of 6 sister companies under one flagship company after go live
Dear Experts,
phpmailer class & pop.gmail.com?
Code: <?php $mail->IsSMTP();$mail->Host = "pop.gmail.com";$mail->Port = 995;$mail->SMTPAuth = true;$mail->Username =
my sql select id and then update problem.
I need to select some auto incremented ids out of a database and then use those id in a where statement which updates the database at the id's location the below code works up to the update statements
php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have those files download together. Can I have it download a folder? Or maybe have it create a zip/rar file
Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y int 3' in an easy way with maybe a for loop or something?I want the data entered to be like this:0x
Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to do is only add the new values.I am guessing that a script that compared the first xx chars of the
Database 'Validation'
Hi everyone,I'm trying to validate the password entered by the user with the password in the database. I've worked out that it checks the username fine (if the username doesn't exist it displays an
Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.But, I'm stuck - the file isn't downloading, and no error is being shown (I've enabled E_ALL error