473,666 Members | 2,060 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 1447
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
1855
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 values that are pulled from the GPS unit every 30 seconds. I need to find the duration of time for when a vehicle is stopped. I have created a cursor that runs though all of the tables, and gathers the data for when the vehicle's speed is equal to...
6
10471
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
7392
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 recommend storing the image to the filesystem and only keeping a pointer to that in the table. I want to dump the image to a table. My code dumps the data into the table, however, I get the following error when trying to view the image "the image ......
10
2339
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 the DataAdd part (Section heading is Adding Rows to a DataSet) I dont really know what to do after i have added all the
5
2803
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 line is $inputEngine the array secondline is $inputCylinder Head etc..
10
13401
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 a problem. I am using chunk_split(data) and the base64_encode and base64_decode on the files. I do a select from the database, and then echo the image (with header(Content Type: image/jpeg) and the decoded image displays fine. Yes, I have...
3
5991
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 the same data as parameter to the procedure. In that case i get the error : "Cannot insert duplicate key row in object ...." The functionality of the proc is - It checks if a given data (Based on Unique key) is present in the table or not. If...
12
4411
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 table. Then read the second line in text file and repeat. Thanks for your time Ian
1
4968
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 table for multiple Nvarchar fields...). I know how to insert new text into the Nvarchar fields: INSERT INTO tblNotes ( noteID, note ) SELECT 1, N'This is a unicode note' but the problem I'm having is when I'm pulling the text to insert from...
1
1980
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 checked only one, either, option 1, or option 2 or option 3 I'm able to see it in the column in the correct table of mysql but when I check more then one box only the last box would insert into the column, ignoring the rest. In this case, if I check the...
0
8448
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8552
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.