Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2009, 06:05 AM
Registered User
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Update specific field at specific time

I have monthly_views field in my table. I want to know how i can update that field if i want to start that field to be updated when new month is started.

e.g if the count for a specific page is 30 at end of the month
then it should start from 0 when new month is started, how it should be done in php with mysql
 
Old August 12th, 2009, 03:16 PM
Authorized User
 
Join Date: Mar 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default mktime

using php mktime function, get the month.
$month = date("m",mktime());

if $month <> $storedmonthindb
then
store the month in the db somehwere
and reset your page counter.
----





Similar Threads
Thread Thread Starter Forum Replies Last Post
Run a macro at a certain / specific time Andy84 BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5 1 June 8th, 2009 05:19 AM
Search specific data from specific columns yogeshyl SQL Language 1 January 16th, 2008 11:12 AM
Copy specific data in specific cells of sheet2 yogeshyl Excel VBA 1 May 14th, 2007 07:40 AM
How i can insert specific delay time in microsseco eakkaluck Visual C++ 1 November 2nd, 2005 05:52 PM
Field Specific DISTINCT Statement tdaustin Classic ASP Basics 1 March 30th, 2004 12:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.