473,508 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to insert automatically data into mysql table by php after fixed time duration

6 New Member
Actually i am creating a punching tool in which we will punch so that if someone will not that after 6 hour automatically a query would be submitting like a notification so please tell me how can i insert data into mysql table in php automatically.
Apr 17 '19 #1
8 1434
gits
5,390 Recognized Expert Moderator Expert
not sure what a 'punching tool' is - but i would say that this requirement is to be implemented in another way. you just need a timestamp that is always updated on a request so the application can always compare that timestamp and see if the entry is 'too old' or not.

to have the possibility to update something in an interval by php it would require to run a php process indefinitly - which basically could be done by running a php process at the commandline - preferably as a service on that machine - which isnt a preferable way to do things since the above solution would avoid that already. It would have to check all entries all the time and see which one to update - so it would create unnecessary load on the machine ressources as well as on the database.
Apr 17 '19 #2
mohitvats
6 New Member
okey but how to insert data automatically in mysql database.
Apr 17 '19 #3
gits
5,390 Recognized Expert Moderator Expert
why would you need that? there shouldn't be a reason for that - since it simply can be done with correct updates and comparisons of a timestamp.

you would need to explain more what exactly you want to achieve - there are really rare needs of having something like a service that does inserts or updates in a DB periodically - most can/should be solved without such for already mentioned reasons.
Apr 17 '19 #4
mohitvats
6 New Member
i need for a reason that is if employee not submit his entry at office time than after 6 hour automatically system submit a query for him.
Apr 17 '19 #5
gits
5,390 Recognized Expert Moderator Expert
let me try to understand that since its still unclearly explained:

an employee should do some entry and when he did not do that entry - basically a record is missing.

now you want to insert some default record for that automatically?
Apr 17 '19 #6
mohitvats
6 New Member
Yes, I want a message should be automatically insert into database like for your understanding like notification.
Apr 18 '19 #7
gits
5,390 Recognized Expert Moderator Expert
ok - but whatfor? basically at some point the records will be read from the database - so while doing that a program could react to any missing or 'too old' entries by simply comparing a timestamp or existence of a record. this way the DB wouldnt be polluted with default entries that wouldnt be needed - since a program can generate such notifications on the fly.

if you still insist to insert something into the DB you might simply write a php program that checks which records to be added and start it from a cronjob after the office hours for example. that way there could be a 'job' that inserts those records once per day.
Apr 18 '19 #8
mohitvats
6 New Member
ok Thank you gits i also thinking to do with cronjob but that is possible only on live server not local server. thank you.
Apr 18 '19 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1843
by: Dave | last post by:
I am working with a proprietary database that records the date, time, location, and speed of a vehicle. It is pulling this information from GPS unit tied to a vehicle. The table is populated with...
6
10457
by: Tuong Do | last post by:
Hi, I am going to insert a large amount (200,000 records) of data into a table Is there a way that I can temporarily disable the log? so that the insertion run faster Thanks in advance
10
7378
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
10
2316
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to...
5
2780
by: Stephen Preston | last post by:
Trying to load an multidimensional array into a MySQL table with columns as follows, level1,level2,level3,illust,item,description,partNo,qua,price,remarks,weight ,size,mass the array first...
10
13361
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without...
3
5950
by: Subrat Das | last post by:
Hi, I have a java application which calls a stored procedure to insert data into a table.Multiple threads of java call the same procedure at the same time. Sometimes it happens that few threads send...
12
4395
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql...
1
4956
by: cathycros | last post by:
Hi, I'm trying to take data from varchar fields in one table and copy it to Nvarchar fields in another table. (Long story - now dealing with multiple languages, not enough space in row in current...
1
1970
by: Mike Massaro | last post by:
Hello everyone, I'm working on adding checkboxes to the edit_profile section where members should be able choose with checkboxes the multiple options of massage techniques offered... When I...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.