-2

I'm writing a time recording program for the company I work for. I'm using the a form to capture data from the user end.

I will be creating a dynamic interface for the managers to see what client currently handled by which user. To do this I will be auto submitting "User Name", "Category", "Client Name" and "Start Time" to a temporary table which will hold the data only for that day.

I want to know if there's a way to this using PHP script which will be running in timed manner to TRUNCATE the temporary table on each day. I'm using MySQL as my database software.

This not a duplicate of this I'm asking to run a PHP in a timed manner

UPDATE: I think I found my own solution to this problem thank you all for the help will update this when I get it to work.

UPDATE: I used this method in order to do what I wanted to do link

Community
  • 1
  • 1
S4NDM4N
  • 904
  • 2
  • 11
  • 26
  • Possible duplicate of [Empty a MySQL table hourly](http://stackoverflow.com/questions/19555712/empty-a-mysql-table-hourly) – mwhs Apr 20 '17 at 05:39

2 Answers2

0

First of all you need two table fields name date_only and status. Then in your code check date_only is today's date and user status is active then you extract "User Name", "Category", "Client Name" and "Start Time" of a specific manager.

If a manager manage how many number of users then the users status is active other users status are inactive

A.A Noman
  • 5,244
  • 9
  • 24
  • 46
0

If the server is hosted on Unix Based OS, you can settle a cron job to truncate the temp table at 12:00 am of everyday. Cron executes the scheduled commands and for Windows based OS you can use task scheduler.

More details: https://www.pantz.org/software/cron/croninfo.html

How do I run a PHP script using windows schedule task?

Hope it helps

Community
  • 1
  • 1
Zaman
  • 551
  • 4
  • 8