Solved

PHP MySQL mktime weekly data

Posted on 2011-02-25
1
395 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now