Solved

PHP MySQL mktime weekly data

Posted on 2011-02-25
1
408 Views
Last Modified: 2012-05-11
I have a visitors log table with the time in the mktime format. I want to generate the weekly report based on this data. How can I do weekly increment of the mktime from min mktime to the max mktime. I need to count the weekly hits from this.
0
Comment
Question by:PranjalShah
1 Comment
 
LVL 3

Accepted Solution

by:
Zakabog earned 500 total points
ID: 34985258
<?php

$minTime = mktime(); // Your starting mktime
$maxTime = strtotime("+1 week", $minTime); // One week after your starting mktime

echo date("Y-m-d", $minTime) . " - " . date("Y-m-d", $maxTime); // Print out your $minTime and $maxTime to show you it's working

?>
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question